[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Getting AuthCookie to work on W2K
From:       "Hill, Ronald" <ronald.hill () eds ! com>
Date:       2002-05-30 15:10:15
[Download RAW message or body]

Hello All,

I am trying to setup the Apache-AuthCookie module and have run into a
problem. Every time
I try to login it just returns my back to the login screen. I can't get past
the login screen!!
(I have tried with Netscape and IE). Next I wrote a perl script to check
things out. (same thing!!)

according to the apache log file it seems that the server is not receiving
the cookie but according
to the LWP debug information it is sending it out!!

Does anyone have any idea what is wrong? What have I missed?

Thanks

Ron
 

====================login.pl script=====================
#!/usr/bin/perl -w
use HTTP::Request::Common;
use HTML::Form;
use LWP::UserAgent;

use LWP::Debug qw(+);
BEGIN {
    local $^W = 0;
    *LWP::UserAgent::redirect_ok = sub {1}
}
use HTTP::Cookies;
use strict;

my $ua        = LWP::UserAgent->new;
$ua->cookie_jar(
  HTTP::Cookies->new(
    autosave => 1 )
);

my $request  = $ua->request( POST 'http://cypci748/uganswer/index.html' );

#print $request->as_string;

my $form = HTML::Form->parse( $request->content, $request->base());
$form->value( 'credential_0',   "programmer" );
$form->value( 'credential_1', "Hero" );

my $response = $ua->request( $form->click('submit') );

print $response->as_string;

=================output from login.pl (lwp debug
information)=========================
F:\scripts>login.pl
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking cypci748.local for cookies
HTTP::Cookies::add_cookie_header: Checking .local for cookies
LWP::UserAgent::send_request: POST http://cypci748/uganswer/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 763 bytes
LWP::Protocol::collect: read 692 bytes
LWP::UserAgent::request: Simple response: OK
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking cypci748.local for cookies
HTTP::Cookies::add_cookie_header: Checking .local for cookies
LWP::UserAgent::send_request: POST http://cypci748/LOGIN
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 265 bytes
HTTP::Cookies::extract_cookies: Set cookie Apache::UGA::AuthCookieHandler_Wh
er => programmer:Hero
LWP::UserAgent::request: Simple response: Found
LWP::UserAgent::request: ()
HTTP::Cookies::add_cookie_header: Checking cypci748.local for cookies
HTTP::Cookies::add_cookie_header: Checking .local for cookies
LWP::UserAgent::send_request: POST http://cypci748/uganswer/index.html
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::collect: read 763 bytes
LWP::Protocol::collect: read 692 bytes
LWP::UserAgent::request: Simple response: OK
HTTP/1.1 200 OK
Cache-Control: no-cache
Connection: close
Date: Thu, 30 May 2002 13:51:59 GMT
Pragma: no-cache
Server: Apache/1.3.19 (Win32) AxKit/1.51 mod_perl/1.26
Content-Length: 1455
Content-Type: text/html
Expires: Thu, 30 May 2002 13:51:59 GMT
Client-Date: Thu, 30 May 2002 13:51:59 GMT
Client-Response-Num: 1

[ the login form was here]
============================Apache error_log
file===============================

[Thu May 30 06:51:59 2002] [error] auth_type Apache::UGA::AuthCookieHandler
[Thu May 30 06:51:59 2002] [error] auth_name WhatEver
[Thu May 30 06:51:59 2002] [error] ses_key_cookie 
[Thu May 30 06:51:59 2002] [error] uri /uganswer/index.html
[Thu May 30 06:51:59 2002] [error] Converting POST -> GET
[Thu May 30 06:51:59 2002] [error] credential_0 programmer
[Thu May 30 06:51:59 2002] [error] credential_1 Hero
[Thu May 30 06:51:59 2002] [error] ses_key programmer:Hero
[Thu May 30 06:51:59 2002] [error] auth_type Apache::UGA::AuthCookieHandler
[Thu May 30 06:51:59 2002] [error] auth_name WhatEver
[Thu May 30 06:51:59 2002] [error] ses_key_cookie 
[Thu May 30 06:51:59 2002] [error] uri /uganswer/index.html

============================Apache http.conf file for
AuthCookie================
<Location /perl/>
    SetHandler  perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
    </Location>

    PerlModule Apache::AuthCookie
    PerlModule Apache::UGA::AuthCookieHandler
    PerlSetVar WhatEverPath f:/Apache/cgi-bin/
    PerlSetVar WhatEverLoginScript /perl/login.pl
    PerlSetVar AuthCookieDebug 3
    
    <Location /uganswer/>
    AuthType Apache::UGA::AuthCookieHandler
    AuthName WhatEver
    PerlAuthenHandler Apache::UGA::AuthCookieHandler->authenticate
    PerlAuthzHandler Apache::UGA::AuthCookieHandler->authorize
    Require user programmer
    </Location>
 <Location /LOGIN>
  AuthType Apache::UGA::AuthCookieHandler
  AuthName WhatEver
  SetHandler perl-script
  PerlHandler Apache::UGA::AuthCookieHandler->login
 </Location>





[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic