t.c.c.DigestCredentialFactory(object) : class documentation

Part of twisted.cred.credentials View Source View In Hierarchy

Support for RFC2617 HTTP Digest Authentication
ParametersalgorithmCase insensitive string specifying the hash algorithm to use. Must be either 'md5' or 'sha'. 'md5-sess' is not supported. (type: str)
authenticationRealmcase sensitive string that specifies the realm portion of the challenge (type: str)
Class Variable CHALLENGE_LIFETIME_SECS The number of seconds for which an opaque should be valid.
Instance Variable privateKey A random string used for generating the secure opaque. (type: str)
Method __init__ Undocumented
Method getChallenge Generate the challenge for use in the WWW-Authenticate header.
Method decode Decode the given response and attempt to generate a DigestedCredentials from it.
Method _generateNonce Create a random value suitable for use as the nonce parameter of a WWW-Authenticate challenge.
Method _getTime Parameterize the time based seed used in _generateOpaque so we can deterministically unittest it's behavior.
Method _generateOpaque Generate an opaque to be returned to the client. This is a unique string that can be returned to us and verified.
Method _verifyOpaque Given the opaque and nonce from the request, as well as the client IP that made the request, verify that the opaque was generated by us. And that it's not too old.
CHALLENGE_LIFETIME_SECS =
The number of seconds for which an opaque should be valid.
privateKey =
A random string used for generating the secure opaque. (type: str)
def __init__(self, algorithm, authenticationRealm): (source)
Undocumented
def getChallenge(self, address): (source)
Generate the challenge for use in the WWW-Authenticate header.
ParametersaddressThe client address to which this challenge is being sent.
ReturnsThe dict that can be used to generate a WWW-Authenticate header.
def _generateNonce(self): (source)
Create a random value suitable for use as the nonce parameter of a WWW-Authenticate challenge.
Returns (type: str)
def _getTime(self): (source)
Parameterize the time based seed used in _generateOpaque so we can deterministically unittest it's behavior.
def _generateOpaque(self, nonce, clientip): (source)
Generate an opaque to be returned to the client. This is a unique string that can be returned to us and verified.
def _verifyOpaque(self, opaque, nonce, clientip): (source)
Given the opaque and nonce from the request, as well as the client IP that made the request, verify that the opaque was generated by us. And that it's not too old.
ParametersopaqueThe opaque value from the Digest response
nonceThe nonce value from the Digest response
clientipThe remote IP address of the client making the request or None if the request was submitted over a channel where this does not make sense.
ReturnsTrue if the opaque was successfully verified.
Raiseserror.LoginFailedif opaque could not be parsed or contained the wrong values.
def decode(self, response, method, host): (source)
Decode the given response and attempt to generate a DigestedCredentials from it.
ParametersresponseA string of comma seperated key=value pairs (type: str)
methodThe action requested to which this response is addressed (GET, POST, INVITE, OPTIONS, etc). (type: str)
hostThe address the request was sent from. (type: str)
ReturnsDigestedCredentials
Raiseserror.LoginFailedIf the response does not contain a username, a nonce, an opaque, or if the opaque is invalid.
API Documentation for Twisted, generated by pydoctor at 2012-09-01 11:44:56.