I added a username and password for a basic authentication on Apache, and I want to have Unicode AuthName strings to my users. My httpd.conf looks like this:
<Location "/">
AuthType Basic
AuthName "Some Unicode Here"
AuthUserFile /somewhere/htpasswd
Require valid-user
</Location>
But “Some Unicode Here” always appears to be garbage in my browser. How do I make it appear properly?
You may not be able to make it work, lack of browser support is the main issue, see What character encoding should I use for a HTTP header?.
The
AuthNameappears as the realm in theWWW-Authenticateheader:Some quick experimentation shows:
AuthNamestring in the config, it sends it as-is=?utf-8?B?U29tZSBVbmljb2RlIEhlcmUK?=(I suggest
mod_auth_tktas cookie-based a replacement for basic auth if you have the option, it has a drop-in htpasswd style perl script, and setsREMOTE_USER, you just need to roll your own form.)