In the WWW-Authenticate header Catalyst::Authentication::Credential::HTTP sends the following value for qop:
qop="auth,auth-int"
This is identical to the example given in section 3.5 of the RFC (http://tools.ietf.org/html/rfc2617#section-3.5 ), so I assume this is correct.
urllib2 does not expect multiple values for qop, and only works when qop="auth".
I've managed to work around it with:
class DigestAuthHandler (urllib2.HTTPDigestAuthHandler):
def get_authorization (self, req, chal):
qop = chal.get ('qop', None)
if qop and ',' in qop and 'auth' in qop.split (','):
chal['qop'] = 'auth'
return urllib2.HTTPDigestAuthHandler.get_authorization (self, req, chal)
|