in reply to Re^2: LWP and Digest Authentication
in thread LWP and Digest Authentication
It applies to digest as well. I use the following in one of my programs for a site that uses digest:
sub get_basic_credentials { my ($self, $realm, $uri, $isproxy) = @_; if ( !$isproxy && $realm eq 'example' && $uri->host_port() =~ /(^|\.)example\.com:80\z/i ) { return ($self->{user}, $self->{passwd}); } return $self->SUPER::get_basic_credentials($realm, $uri, $isproxy); }
credentials populates a hash which the base get_basic_credentials accesses. That's fine for most uses. If it isn't, overridding get_basic_credentials gives extra flexibility. In my case, the realm is fixed, but there's an unlimited number of subdomains being accessed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: LWP and Digest Authentication
by BrowserUk (Patriarch) on Feb 11, 2009 at 03:15 UTC | |
by ikegami (Patriarch) on Feb 11, 2009 at 03:51 UTC | |
|
Re^4: LWP and Digest Authentication
by BrowserUk (Patriarch) on Feb 11, 2009 at 03:24 UTC | |
by ikegami (Patriarch) on Feb 11, 2009 at 03:49 UTC | |
by BrowserUk (Patriarch) on Feb 11, 2009 at 04:24 UTC | |
by ikegami (Patriarch) on Feb 11, 2009 at 05:12 UTC | |
by BrowserUk (Patriarch) on Feb 11, 2009 at 14:36 UTC | |
|