开发者

Digest authentication refuses to accept valid credentials

I'm trying to protect a folder with Digest Authentication through a .htaccess file:

AuthType Digest
AuthName "Restricted Ar开发者_如何学Goea"
AuthUserFile /web/htdocs/www.domain.com/.../.htdigest

Require valid-user

I've created the file of passwords with the comand "htdigest". All works fine on my local server ... but not on my remote server (hosted website)! The browser shows the login panel even if I enter a correct password!

On the remote server PHP is running as CGI not as a module of Apache ... should be this the cause? Is there some workaround?

A Basic Authentication with .htaccess works fine on the same remote server!


If the script is running as CGI, that means it is running as the local user, not as www, which is probably the problem, yes. Is CGI the only option?


The code above is missing the AuthDigestDomain directive, about that the documentation says:

This directive should always be specified and contain at least the (set of) root URI(s) for this space. Omitting to do so will cause the client to send the Authorization header for every request sent to this server. Apart from increasing the size of the request, it may also have a detrimental effect on performance if AuthDigestNcCheck is on.

However, I've definitely solved the problem by enabling the Apache module mod_auth_digest instead of the module mod_digest.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜