Has anyone actually got this working? How about with IIS6 and Windows Server 2003?
I tried to implement this into a web spider that searches our internal site that uses Integrated Windows Authentication and it always fails using the documented implementation. V/r, Charles ----- Original Message ----- From: "Paul O'Russa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 1:12 PM Subject: RE: LWP and authentication not working with IIS I'm already using Basic authentication. I went to look for that NTLM module anyway and found an example of how to use it. It showed a sample of how to use the credentials() method, which, as it turns out, I was not passing correct parameters to. :-) The first parameter must have a ":80" at the end of it or it won't work properly: $ua->credentials('www.somewhere.com:80', 'www.somewhere.com', 'username', 'password'); Doh! Thanks for your help... Paul >>> Thomas_M <[EMAIL PROTECTED]> 1/9/2003 9:18:53 AM >>> I believe Windows requires NTLM authentication (aka Windows Challenge/Response) to access NTFS protected directories. LWP uses Basic authentication by default, so that's why it didn't work. You could either (1) Configure IIS to protect the pages using Basic authentication instead of using Windows security settings, or (2) Configure LWP to perform NTLM authentication (try the LWP::Authen::NTLM module). - Mark. -- Mark Thomas [EMAIL PROTECTED] Internet Systems Architect User Technology Associates, Inc. $_=q;KvtuyboopuifeyQQfeemyibdlfee;; y.e.s. ;y+B-x+A-w+s; ;y;y; ;;print;; > -----Original Message----- > From: Paul O'Russa [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 09, 2003 11:40 AM > To: [EMAIL PROTECTED] > Subject: LWP and authentication not working with IIS > > > I have been trying to find a good way to verify a user's > username and password via Perl on Windows 2000 using IIS. > What I've done is setup a web page that is protected via > Windows security settings (i.e. NTFS) and then try using LWP > to retrieve that page, passing in the credentials. Like this > below (url's, username, and password changed to protect the innocent): > > ------------------------------------------- > use LWP; > > my $ua = LWP::UserAgent->new; > $ua->credentials('www.somewhere.com', 'www.somewhere.com', > 'username', 'password'); > > my $url = 'http://www.somewhere.com/dir/securepage.asp'; > my $response = $ua->get($url); > > print > "Error: " . $response->header('WWW-Authenticate') . "\n" . > 'Error accessing' . "\n " . > $response->status_line . "\n" . > " at |$url|" > unless $response->is_success; > ------------------------------------------- > > But the authentication does not appear to work. I get this > for output: > > Error: Basic realm="www.somewhere.com" > Error accessing > 401 Unauthorized > at |http://www.somewhere.com/dir/securepage.asp| > > > If I change the URL to point to a page that is available > anonymously, it works fine. If I access that same URL via a > web browser and log in manually using the same > username/password I get in just fine. > > Can anyone explain what I am doing wrong, or what I should be > doing to make it work? > > Thank you, > > Paul O'Russa > > > > _______________________________________________ > Perl-Win32-Web mailing list [EMAIL PROTECTED] > To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs > _______________________________________________ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs _______________________________________________ Perl-Win32-Web mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs