开发者

How to get in Apache password protected directories without showing popup login

I read here how to get into an Apache password protected directroy via dircet link with the simple:

http://username:password@yoursite.com/protected_dir/ 

that works in FF/Chrome/Safari, and obviously not in IE7! :)

Do you know how could i get into a psw protected directory creating maybe a login f开发者_JAVA技巧orm and using GET/POST to get in?

Do I need to set a session before getting in or I can simply pass to the protected directory the user and password as GET/POST parameters? (In this last case what name for parameters do I have to use?)

Thanks!


What you're referring to is HTTP authentication, and is not handled with URL parameters or POST data.

A HTTP client must handle it directly.

Now, if you have no control over the password protected directory, there's nothing you can do.
If, however, you do have control and want to provide an HTML login form, you must change the method of authentication and, instead of relying on HTTP authentication, do it via URL parameters or POST data. You can do that not using a different authentication type module for a Apache (necessarily a third-party one, because Apache only supports HTTP Basic and Digest authentication), or, more realistically, doing the authentication with PHP and managing a session.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜