Thread Auto Login auf einer Basic Auth seite
(9 answers)
Opened by phonk at 2007-10-23 13:28 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 package test::login; use strict; use Apache::RequestRec (); use LWP; use LWP::UserAgent; my $response = ""; sub handler { my $r = shift; $r->content_type('text/html'); $r->rflush; # send the headers out my $agent = LWP::UserAgent->new; my $request = HTTP::Request->new(GET =>"http://www.test.com/index.jsp"); $request->authorization_basic('user', 'pass'); $response = $agent->request($request); $response->is_success or print STDERR "Fehler: ", $response->message, "\n" and die; $r->print("<meta http-equiv='refresh' content='1;URL=http://www.test.com/index.jsp'>" ); return Apache::OK; } 1; So habe ich es probiert. |