HTTP authentication (Basic, Digest, Negotiate)
A server can make the browser ask for a username and password.
In one line
Can make your browser ask for a username and password in a plain box
A server can make the browser ask for a username and password.
Browser shows a native login box and then sends credentials on every request to that realm.
What it can and can't do
What the user does: You open a page that is protected, and a login box appears
It can
- Show a login box from the browser itself
- Receive the username and password you type
- Send those details again with every request to that part of the site
It cannot
- Get your saved passwords unless you pick them from the browser box
- Hide the box behind a custom design; it is always the browser's own box
- Keep you signed in after you close the browser on most setups
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1.0 | 2008-12-11 | None |
| Edge | Supported | 1.0 | Not listed | None |
| Firefox | Supported | 1.0 | 2004-11-09 | None |
| Safari | Supported | 1.0 | 2003-06-23 | None |
| Safari on iPhone | Supported | 1.0 | 2007-06-29 | None |
| Chrome on Android | Supported | 1.0 | Not listed | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | WWW-Authenticate: Basic realm=...; Authorization header; Negotiate/NTLM for Windows SSO |
| How access is granted | prompt |
| What the user sees | Native login dialog |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | No |
| How long it lasts | Per origin |
| How to take it back | Site settings |
| Inside an iframe | Same as top level; cross-origin iframes need a permissions policy where listed |
Typical flow
- Call the API
- Browser applies its access rules
- Page receives the result
Data you get
What comes back: A server can make the browser ask for a username and password.
Shape: object
How often: on demand
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
Authorization | string | None | Base64 user:password for Basic | sent with every request |
Technical limits
- Basic sends the password every request
- Negotiate uses Kerberos or NTLM only on allowlisted intranet hosts
The story
What it is
The server makes your browser pop up a plain username and password box.
For you
A grey box from the browser itself appears with 'username' and 'password'. After you type, the browser silently resends them on every click on that site until you close it. Many people meet this on staging sites, routers and old company tools.
For makers
It is the quickest way to password protect something with no login page to build. Makers use it for private previews, internal dashboards, device admin pages and simple APIs.
Where you see it
| Type | Example | Apps |
|---|---|---|
| developer | A web agency hides a client's unfinished site behind a browser login box so only the client can look at it. | Netlify, Vercel previews |
| smart-home | A home router or camera admin page asks for a username and password in a plain box when you type its local address. | None named |
| enterprise | A company's internal wiki on an old server uses single sign on through the browser, so staff on the work network are let in without typing. | None named |
| games | A game studio shares a private playtest build on a password box so only invited testers see the unreleased game. | None named |
| analytics | A reporting tool lets a script fetch data using the same method, so a person and a program use one login style. | None named |
| security | A scanner tries common default passwords on these boxes, so the same simple gate that protects can also be attacked. | None named |
Risks
- Password resent on every request
- No sign out button
What the platform says
- MDN (standards docs): HTTP authentication. Explains the built in login box that servers can trigger with a challenge, used for simple password protection.
Good uses and abuse
Legitimate uses
- Intranet SSO
- Simple gating
Known abuse
- Phishing with credentials in URL (restricted)
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 4 of 5 | How revealing the data is |
| Utility | 2 of 5 | How useful it is to honest apps |
| Friction | 2 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 1996, Chrome 1: Basic and Digest from the start
- 2017, Chrome 59: Credentials in URLs (user:pass@host) blocked for subresources
Sources
How well checked: Based on official documentation.