Skip to main content

Monitoring pages behind Basic Authentication

HTTP Basic Authentication 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 send an Authorization header with each request or include the user credentials in the URL.

Basic Auth dialog

Setting the Authorization header with the Basic Auth setting

  1. Open your page settings
  2. Click Show Advanced
  3. Expand the Basic Auth section
  4. Click Add Basic Auth
  5. Click Create or select an existing configuration
  6. Enter a name for the setting, plus username and password

Basic Auth Form

Finally, click Create and the setting will be added to your page.

Basic Auth Setting

Passing credentials in the URL

You can also inlucude credentials directly in the website URL.

Suppose you want to monitor http://example.com, with the username sam and password hunter2. You'll be able to access the site if you use this URL: http://sam:hunter2@example.com

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.