1

I have a project which is protected by std AuthUserFile-directive in .htaccess.

Everything is quite simple and has already been fine on another server. Here is the content of my .htaccess:

The .htaccess:

AuthName "Adminbereich"
AuthType Basic
AuthUserFile /srv/www/passwords/.htpasswd-office

<Files *.php>
require valid-user
</Files>

The .htpasswd-office gets accessed. If I call http://user:pass@host/ I get in. If I just call http://host/ I get this message immediately ...

Authorization Required

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.

... without any login-box showing. What could be the cause of this?

This is a example-header from here: http://www.pagetutor.com/keeper/mystash/secretstuff.html

HTTP/1.1 401 Authorization Required
Date: Thu, 01 Nov 2012 21:38:27 GMT
Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
WWW-Authenticate: Basic realm="My Secret Area"
Accept-Ranges: bytes
Content-Length: 343
Content-Type: text/html

And this is my header:

HTTP/1.1 401 Authorization Required
Date: Thu, 01 Nov 2012 21:36:41 GMT
Server: Apache/2.2.20 (Ubuntu)
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

The magic WWW-Authenticate: Basic realm="..." is missing and I have no idea why...

I use the standard ubuntu (11.10) apache (2.2.20) without any modifications...

Ron
  • 1,336
  • 12
  • 20
  • That's the correct response, a 401. The reason why your browser isn't showing a login dialog isn't because of apache or its configuration. – Jon Lin Oct 31 '12 at 23:20
  • The response is correct. But I dont have been asked for a username and a password. The 401 comes immediately - thats my problem. – Ron Nov 01 '12 at 14:42
  • The 401 tells the browser "you need to pop up that login dialog of yours and try again", the 403 means, "either you've kept giving me the wrong username/password, or you simply aren't allowed to access this". You are getting a 401, your browser simply isn't showing the dialog – Jon Lin Nov 01 '12 at 17:06

0 Answers0