HTTP Authentication
Monitor Password-Protected Pages
Section titled “Monitor Password-Protected Pages”Page speed tests can send an HTTP authentication header with every audit request. This lets you track pages that sit behind a login, such as staging environments, admin dashboards or member areas, the same way you monitor public pages.
Supported authentication types
Section titled “Supported authentication types”- Basic Auth: enter a username and password and LoadFocus builds the
Authorization: Basicheader for you. - Bearer Token: paste an API or access token and it is sent as
Authorization: Bearer <token>. - Custom Header: send any single header name and value, for example
X-Api-Key, or aCookieheader for session-protected pages. - Cookies: enter one
name=valueper line. They are sent as aCookieheader with every request of the audit, including third-party requests.
Steps to add authentication to a test
Section titled “Steps to add authentication to a test”- Open the Tests page and click New Test (or Create New, then Test).
- Fill in the URL, name, location and device as usual.
- In the Authentication (optional) dropdown, pick Basic Auth, Bearer Token, Custom Header or Cookies.
- Fill in the credential fields that appear.
- Run the test now or save it with a schedule. Scheduled runs keep using the saved authentication automatically.
When you edit a test that already has saved authentication, the form says so and keeps it unless you enter new values. To stop sending it, tick Remove saved authentication and save the test.
Monitoring pages behind a session login
Section titled “Monitoring pages behind a session login”If your page uses a session cookie instead of Basic Auth or a token, log in with your browser, copy the session cookie from the developer tools, then pick Cookies under Authentication (optional) and enter your_cookie_name=your_cookie_value, one cookie per line. As long as the session stays valid, the test renders the logged-in page. If the session expires, the test quietly starts measuring your login page instead, so check the result screenshot if scores change unexpectedly.
Good to know
Section titled “Good to know”- The header is attached to every request Lighthouse makes during the audit, including assets loaded by the page.
- LoadFocus removes the header from the stored results and masks its value in the report. Values shorter than 8 characters are not masked, so avoid very short secrets in a custom header.
- Header values cannot contain single quotes or control characters, names are limited to 128 characters and values to 2048 characters.
- Combine authentication with alerts to get notified when a protected page slows down.