in reply to Re^2: ISA Proxy and LWP
in thread ISA Proxy and LWP

That's not what I asked for.

Replies are listed 'Best First'.
Re^4: ISA Proxy and LWP
by perlnewb123 (Sexton) on Oct 18, 2008 at 03:15 UTC
    That's the response im getting back from the webservice. 401. I know im using the right creds, etc. Looking on other groups, etc, a lot of people have this same problem. Also tried running this with Mechanize:
    use HTTP::Request::Common; use Data::Dumper; use WWW::Mechanize; use MIME::Base64; my $url = 'http://test.test.com/webservices/test.asmx?; my $Domain = 'test'; my $UserName = 'test\\user'; my $Password = "pass"; my $agent = WWW::Mechanize->new(); my @args = ( Authorization => "Basic " . MIME::Base64::encode( $UserName . ':' . $Password ) ); $agent->credentials( 'http://test.test.com' , $Domain, $UserName, $Pas +sword ); my $results = $agent->get( $url, @args ); print Dumper($results);
    Results:
    $VAR1 = bless( { '_protocol' => 'HTTP/1.1', '_content' => '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTM +L 4.01//EN " "http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>You are not authorized to view this page</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-12 +52"> <STYLE type="text/css"> BODY { font: 8pt/12pt verdana } H1 { font: 13pt/15pt verdana } H2 { font: 8pt/12pt verdana } A:link { color: red } A:visited { color: maroon } </STYLE> </HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD> <h1>You are not authorized to view this page</h1> You do not have permission to view this directory or page using the cr +edentials that you supplied because your Web browser is sending a WWW-Authentica +te header field that the Web server is not configured to accept. <hr> <p>Please try the following:</p> <ul> <li>Contact the Web site administrator if you believe you should be ab +le to view this directory or page.</li> <li>Click the <a href="javascript:location.reload()">Refresh</a> butto +n to try a gain with different credentials.</li> </ul> <h2>HTTP Error 401.2 - Unauthorized: Access is denied due to server co +nfiguratio n.<br>Internet Information Services (IIS)</h2> <hr> <p>Technical Information (for support personnel)</p> <ul> <li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Micros +oft Produc t Support Services</a> and perform a title search for the words <b>HTT +P</b> and <b>401</b>.</li> <li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr) +, and search for topics titled <b>About Security</b>, <b>Authentication +</b>, and <b>About Custom Error Messages</b>.</li> </ul> </TD></TR></TABLE></BODY></HTML> ', '_rc' => 401, '_headers' => bless( { 'x-powered-by' => 'ASP.NET', 'client-response-num' => 1, 'date' => 'Sat, 18 Oct 2008 03 +:02:01 GMT ', 'client-peer' => '172.xx.xx.xx +:80', 'content-length' => '1656', 'client-warning' => 'Unsupport +ed authent ication scheme \'ntlm\'', 'client-date' => 'Sat, 18 Oct +2008 03:02 :02 GMT', 'content-type' => [ 'text/html +', 'text/html +; charset= Windows-1252' ], 'www-authenticate' => [ 'Negot +iate', 'NTLM' ], 'server' => 'Microsoft-IIS/6.0 +', 'title' => 'You are not author +ized to vi ew this page' }, 'HTTP::Headers' ), '_msg' => 'Unauthorized', '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = +'http://test.test.com/webservices/test.asmx?')}, 'URI::http' ), '_headers' => bless( { 'user-a +gent' => ' WWW-Mechanize/1.3401', 'accept +-encoding' => 'gzip', 'author +ization' = > 'Basic YmNic2ZsXHN2Yy1pc2R3ZXNwOlI4bjJCMnRjaA== ' }, 'HTTP: +:Headers' ), '_method' => 'GET' }, 'HTTP::Request' ) }, 'HTTP::Response' ); C:\>

      That's the response im getting back from the webservice

      No, that's the status code of the response. I showed you (twice!) how to print the response.

      The Data::Dumper output isn't as readable as ->as_string, but it also holds the info I was seeking:

      'www-authenticate' => [ 'Negotiate', 'NTLM' ],

      LWP only supports basic and digest authentication, but the server is asking for NTLM authentication. I'd start by checking out the module the Anonymous Monk mentioned.

        Thanks. I see a NTLM mod under LWP-Authen. And by calling LWP, it should in turn reference this right?