Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Basic / Digest authentication in website

by alexbio (Monk)
on Jul 11, 2010 at 16:45 UTC ( [id://848851]=note: print w/replies, xml ) Need Help??


in reply to Basic / Digest authentication in website

The information you posted is not sufficient, can you please tell also what you get using the code you showed?

I usually use LWP::UserAgent for GET request with authentication as follows:

use LWP::UserAgent; use HTTP::Request::Common; my ($url, $usr, $pwd, $endpoint, $realm) = @_; my $ua = LWP::UserAgent -> new; $ua -> credentials($endpoint, $realm, $usr, $pwd); my $response = $ua -> request(GET $url) -> as_string;

That is similar to the second code block you posted.

Update: It could be useful if you also post the real URL of the file you are trying to get as http://sub.example.com:49282/navigation/nav_home.shtml and http://server:49282/subpage/nav_home.shtml are not real addresses.

Alex's Log - http://alexlog.co.cc

Replies are listed 'Best First'.
Re^2: Basic / Digest authentication in website
by TheFlyingCorpse (Novice) on Jul 11, 2010 at 17:02 UTC
    The first block of code gives me this output, which also the code example you posted gives me:

    HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Digest realm="GWAVA Console",qop="auth",nonce="d951626547bbe35 ffba6032ba46959bc",opaque="38f98a915296a94de4bbdaa09cb94726"
    Client-Date: Sun, 11 Jul 2010 15:51:19 GMT
    Client-Peer: 10.10.10.10:49282
    Client-Response-Num: 1

    The URL is this: http://mail.isnitro.com:49282/navigation/nav_home.shtml (It is only reachable on the internal network)
      Then find a publicly available site where your problem occurs.
        Trying to set up a site on my home box which mimics now, hold on! :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://848851]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-18 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found