Basic auth and custom HTTP headers

📘

Using authorization headers

If a given request already has authorization headers, mabl will not apply any additional authorization headers to it. Basic authorization or adding a custom HTTP header with authorization will only work on requests that do not contain authorization headers already.

Adding and using basic auth

If your test environment is protected by HTTP basic auth, you can configure mabl tests to run with basic auth credentials. Follow these steps to configure basic auth:

Add basic auth credentials to your workspace

  1. Click on "Configuration" in the left-hand navigation menu.
  2. Select the "Credentials" tab.
  3. Click the "+ New credentials" button. The "Add new credentials" page will appear.
  1. Add the credential name, username and password.
  2. Click the "Save" button.

Add basic auth credentials to your plan

After saving your basic auth credentials, you can configure a plan to enable the HTTP basic auth by taking the following steps:

  1. Navigate to the Plan Details page of the plan you'd like to configure.
  2. Click on the "Edit" icon. The "Plan edit" page will open.
  3. Scroll to the "Device settings" section.
  4. Click on "Advanced options" to open the dropdown menu.
  5. Toggle on "HTTP basic auth required"
  1. Select your credentials from the dropdown that appears.
  1. Click the "Save" button at the bottom of the "Edit plan" page.

📘

Using basic auth and application logins

It is possible to use both HTTP basic auth and application logins at the same time. If basic auth credentials are specified, these will be sent at the HTTP layer with all requests to your test site. If application credentials are also specified, mabl will attempt to login to your application by locating a login form and entering the given credentials.

Adding custom HTTP headers

You can configure mabl to pass custom HTTP headers with each request. These custom headers may be used for authentication or to exercise some specific behavior of your application. To specify custom HTTP headers:

  1. Edit a plan by navigating to the Plans section and choosing a specific plan.
  2. Click on the "Edit" icon. The "Edit plan" page will open.
  1. Scroll to the "Device settings" section.
  2. Click on "Advanced options" to open the dropdown menu.
  3. Toggle on "Send custom HTTP headers."
  1. Add one or more header key-value pairs.
  1. Click the "Save" button at the bottom of the "Edit plan" page.

Did this page help you?