Skip to main content

Monitoring pages behind Basic Auth

HTTP Basic Auth restricts website access by asking visitors to enter a username and password. This article explains how to support this in a monitoring environment.

You can either include the user credentials in the URL, or send an Authorization header with each request.

Basic Auth dialog

Passing credentials in the URL

Suppose you want to monitor, with the username sam and password hunter2.

You'll be able to access the site if you instead use this URL:

Setting the Authorization header

Alternatively, you pass an Authorization header with each request. The header encodes the username and password using Base64, use this tool to generate the Basic Auth header.

Generate Authorization header from username and password

Then enter your project settings, click Show Advanced and set the header.

Set Basic Auth header in DebugBear settings

Error if Basic Auth credentials are not provided

If credentials are not provided to a website that uses Basic Auth you'll see a net::ERR_INVALID_AUTH_CREDENTIALS error. Pass the correct username and password, either in the URL or via the Authorization header.