Basic Authentication

In this lesson, we will learn about handling basic authentication for a given API.

We'll cover the following

What is basic authentication?

The basic authentication scheme requires the user to send the access credentials encoded in base64 or send an authorization token. REST Assured provides an easy way to configure and handle the credentials/token that the request requires.

The authentication is applicable to any HTTP Request like GET, PUT, POST, DELETE, etc.

Example

Let’s understand basic authentication better with an example code snippet:

  • HTTP method: GET
  • Target URL: http://ezifyautomationlabs.com:6565
  • Resource path: /educative-rest/auth/students
  • Authentication type: Basic

Get hands-on with 1200+ tech skills courses.