2
votes

I have a simple HTTP server that does basic authentication. However, it only supports one username ("Admin") and I need this to show up by default on the Username/Password prompt on the browser. Is this possible with Basic Authentication? How should the Response Header look like?

1
I'm guessing "No." (Based on a skim of the relevant bits of the HTTP spec.) I'd try setting the server up to ignore the username and say so in the realm name. - millimoose

1 Answers

3
votes

There is no way for an HTTP server to specify a default username to an HTTP client, in any authentication scheme, and there is no way for an HTTP server to ask an HTTP client to ignore the username field when prompting for credentials. All you can do is configure the HTTP server to ignore usernames (which is a bad idea), and then tell your users not to type them in when prompted.