LWP and Digest authentication



Hi all. I must be missing something here. Is LWP supposed to
automatically deal with digest authentication? I run the following
code (used often with basic auth) against a server requiring digest,
and continue to get 401s:

my $ua = new LWP::UserAgent;
my $h = HTTP::Headers->new();
$h->authorization_basic('user','password');
my $req = HTTP::Request->new('GET', 'http://the.website.com',
$h);
my $res = $ua->request($req);

A sniff shows only one attempt to login, and no reaction to the fact
that the server returned a WWW-Authenticate header with the real,
nonce, etc. Do I need to call requests a different way to get the
auto-magical behavior? I'm using htis format because of other needs
(custom headers later).

Since I can't find any discussion or example of digest instead of
basic, I figured it should work. Or do I need to do all the digest
legwork myself?

Thanks.

.



Relevant Pages

  • Re: Python Scripts to logon to websites
    ... > didn't realize it had all the nonce and anti-replay support it appears ... Digest is actually rarely used, ... used all that much in general these days, since nontrivial web apps ... Digest auth, like basic auth, doesn't require storing the cleartext ...
    (comp.lang.python)
  • Re: LWP and Digest authentication
    ... code (used often with basic auth) against a server requiring digest, ... that the server returned a WWW-Authenticate header with the real, ...
    (comp.lang.perl.modules)