You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Chad Phillips <gp...@home.aafp.org> on 2001/07/06 18:42:10 UTC
AuthCookie question
Hi,
I have set up Authcookie. I modified the sample scripts for my sight.
Everything works except when the wrong password is entered. When an invalid
user/password is entered, instead of re-displaying the login page, I get a
302 Found error to url
http://myhost/LOGIN
Any ideas on what I may have wrong?
thanks
chad
Here is a copy of my httpd.conf file
# In httpd.conf or .htaccess:
PerlModule Sample::AuthCookieHandler
PerlSetVar WhatEverPath /
PerlSetVar WhatEverLoginScript /login.pl
PerlSetVar AuthCookieDebug 3
PerlFreshRestart On
# These documents require user to be logged in.
<Location /members>
AuthType Sample::AuthCookieHandler
AuthName WhatEver
PerlAuthenHandler Sample::AuthCookieHandler->authenticate
PerlAuthzHandler Sample::AuthCookieHandler->authorize
Require valid-user
AllowOverride All
</Location>
<Location /members/cgi-bin>
AuthType Sample::AuthCookieHandler
AuthName WhatEver
PerlAuthenHandler Sample::AuthCookieHandler->authenticate
PerlAuthzHandler Sample::AuthCookieHandler->authorize
Require valid-user
AllowOverride All
</Location>
# These documents don't require logging in, but allow it.
<FilesMatch "\.cgi$">
AuthType Sample::AuthCookieHandler
AuthName WhatEver
PerlAuthenHandler Sample::AuthCookieHandler->authenticate
PerlAuthzHandler Sample::AuthCookieHandler->authorize
Require valid-user
</FilesMatch>
<FilesMatch "\.pl">
AuthType Sample::AuthCookieHandler
AuthName WhatEver
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
PerlAuthenHandler Sample::AuthCookieHandler->authenticate
PerlAuthzHandler Sample::AuthCookieHandler->authorize
Require valid-user
</FilesMatch>
# This is the action of the login.pl script above.
<Files LOGIN>
AuthType Sample::AuthCookieHandler
AuthName WhatEver
SetHandler perl-script
PerlHandler Sample::AuthCookieHandler->login
</Files>
<Location /perl-status>
SetHandler perl-script
PerlHandler Apache::Status
</Location>
Re: AuthCookie question
Posted by darren chamberlain <dl...@users.sourceforge.net>.
Chad Phillips <gp...@home.aafp.org> said something to this effect on 07/06/2001:
> Hi,
> I have set up Authcookie. I modified the sample scripts for my sight.
> Everything works except when the wrong password is entered. When an invalid
> user/password is entered, instead of re-displaying the login page, I get a
> 302 Found error to url
> http://myhost/LOGIN
>
> Any ideas on what I may have wrong?
I didn't see any ErrorDocument settings; try setting it:
ErrorDocument 401 http://myhost/LOGIN
Of course, this will be for the whole virtual server, but
whenever someone doesn't authenticate correctly, they'll be
redirected to the login page.
(darren)
PS The sig is randomly generated, and not aimed at you...
--
The Feynman Problem 1) Write down the problem.
Solving Algorithm 2) Think real hard.
3) Write down the answer.