Basic Authentication with Fiddler Everywhere

Environment

Product Fiddler Everywhere
Product Version 1.0.1 and above

Description

Fiddler Everywhere certificate allows the inspection and debugging of network traffic. The Composer feature in Fiddler Everywhere enables you to manually build and send HTTP or HTTPS requests. Click here to know more about Fiddler Everywhere Composer.

In the context of an HTTP transaction, Basic Access Authentication is a method for an HTTP user agent (for example, a web browser) to provide a user name and password when making a request. In Basic HTTP Authentication, a request contains a header field in the form of Authorization: Basic <base64 string>, where credentials are the Base64 encoding of username and password joined by a single colon(:).

Now, let's see how you can create a Composer request for APIs that require Authentication:

In the steps shown below, you can use httpbin.org for HTTP request and response service.

Step 1

Set the HTTP/HTTPS method to GET and add the URL in the URL field. The added URL has been generated from the httpbin.org.

Composer URL Field

In the above image, the specified URL is https://httpbin.org/basic-auth/user1/pass1. Here basic-auth determines that the Authentication taking place is Basic. The next two fields user1 and pass1 are the values of user and passwd variables, respectively.

Step 2

Create an object inside the Body tab. The predefined variables for the Basic Authentication are user and passwd. Set the values for both variables.

JSON Body

In the above image, the values of the user and passwd variables are user1 and pass1, respectively.

Step 3

Once you create the object in the Body, go to the Headers tab, where you can see a predefined key User-Agent added from Fiddler Everywhere. Now, let's add the Authorization key to the header. For that:

  • Encode the values of the variables set in the JSON format. Encode the texts with simple Base64 converters. The format of the text should be <username>:<password>. The encoded value of user1:pass1 is dXNlcjFwYXNzMQ==.

  • In Headers tab:

    • Set the Key to Authorization.
    • Set the Value to Basic dXNlcjFwYXNzMQ==.
    • Add a Description for the key. Click the tick.

A key named Authorization has been added to the Headers tab.

Authorization Key

After executing all the above steps, click Execute (placed at the right side of the URL field).

Clicking the Execute button will add two more Keys to the Headers tab named Host and Content-Length.

Added Keys to the Headers Tab

Following the above steps will create Basic Authentication with Fiddler Everywhere. To check, go through the Response Inspector section of the Composer. A successful request should return status 200 from the server along with the server-specific payload.

Refer to the image below:

Response Inspector

The above response is HTTPBin specific as we used it to create the Basic Authentication.

In this article