HTTP Basic Authentication - what's the expected web browser experience?

Viewed 479403

When a server allows access via Basic HTTP Authentication, what is the experience expected to be in a web browser?

Ignoring the web browser for a moment, here's how to create a Basic Auth request with curl:

curl -u myusername:mypassword http://somesite.example

But what about in a Web Browser? What I've seen on some websites, is I visit the URL, and then the server returns response code 401. The browser then displays a username/password prompt.

However, on somesite.example, I'm not getting an authorization prompt at all, just a page that says I'm not authorized. Did somesite not implement the Basic Auth workflow correctly, or is there something else I need to do?

6 Answers

You might have old invalid username/password cached in your browser. Try clearing them and check again.

If you are using IE and somesite.example is in your Intranet security zone, IE may be sending your Windows credentials automatically.

Related