in reply to Re^3: LWP::UserAgent Authentication
in thread LWP::UserAgent Authentication

I tried all different strings for the realm. None of them worked. It doesn't specify the realm when it asks for the password. The word 'realm' doesn't even appear in a Sniffer trace. That's why I expected my sample code to work - it by-passes the credentials/realm problem and returns with the correct username/password. I also made sure I included the port number - 80. That was spelled out on one of the web sites: www.tutorials-blog.com/perl/LWPUserAgent-credentials/.

Replies are listed 'Best First'.
Re^5: LWP::UserAgent Authentication
by varian (Chaplain) on Mar 20, 2007 at 19:37 UTC
    The response headers will give away more clues about required authentication, try to insert this into your code:
    $response = $ua->request( <-- your details go here my @headers = $response->header_field_names(); foreach my $h (@headers) { print "$h = ",$response->header($h),"\n"; }
    In particular investigate the output for the WWW-Authenticate header.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: LWP::UserAgent Authentication
by eric256 (Parson) on Mar 20, 2007 at 19:40 UTC

    It would be much easier to help you if you would edit your original post and put <code></code> tags around your code.


    ___________
    Eric Hodges