mantest has asked for the wisdom of the Perl Monks concerning the following question:

Here is my code, not able to login using digest authentication.
use LWP; use LWP::Authen::Digest; my $username = "multiplay"; my $password = "multiplay"; my $url = "http://10.2.2.58:30005"; my $host_port="10.2.2.58:30005"; my $realm="IgdAuthentication"; my $browser = LWP::UserAgent->new(); $browser->env_proxy; $browser->credentials("$host_port","$realm","$username","$password"); my $response=$browser->get($url); ######### when logged in GUI the sniff traces are attached below GET / HTTP/1.1 Host: 10.2.2.58:30005 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8 +) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729) 79880703 Engine/6 +.00231 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0. +8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Cache-Control: max-age=0 HTTP/1.1 401 Unauthorized Content-Length: 0 WWW-Authenticate: Digest realm="IgdAuthentication", domain="/", nonce= +"YzhmZDNjMjU6OTE4MGYzOGY6NTQ1NTljZDk=", qop="auth", algorithm=MD5, op +aque="5ccc09c403ebaf9f0171e9517f40e41" GET / HTTP/1.1 Host: 10.2.2.58:30005 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8 +) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729) 79880703 Engine/6 +.00231 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0. +8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 115 Connection: keep-alive Cache-Control: max-age=0, max-age=0 Authorization: Digest username="multiplay", realm="IgdAuthentication", + nonce="YzhmZDNjMjU6OTE4MGYzOGY6NTQ1NTljZDk=", uri="/", algorithm=MD5 +, response="0a955190d2f9e8f7de84003077a58256", opaque="5ccc09c403ebaf +9f0171e9517f40e41", qop=auth, nc=00000001, cnonce="b75a7950a19c7b75" HTTP/1.1 200 OK Content-Length: 0
I don't know why i am not able to login. Appreciated if you can help me

Replies are listed 'Best First'.
Re: LWP::Authen not working for digest authentication
by ikegami (Patriarch) on Sep 01, 2010 at 14:41 UTC
    What do you mean? You logged in fine (200 OK)
      200 ok is obtained when i logged in using browser and not by script
        We can't fix your problem as you provided absolutely no information as to why it didn't work. As previously mentioned, please provide the trace for when it doesn't work.
Re: LWP::Authen not working for digest authentication
by proceng (Scribe) on Sep 01, 2010 at 17:10 UTC
    when logged in GUI the sniff traces are attached below
    You need to show us the sniff results on the failing attempt, not when it works.

    Start the trace, then make the attempt to log in to the system. That will probably tell you (in comparison to the successful login) where the failure occurred.

Re: LWP::Authen not working for digest authentication
by alexbio (Monk) on Sep 03, 2010 at 17:41 UTC