interface documentation

class ICredentialFactory(Interface): (source)

Known implementations: twisted.web.guard.BasicCredentialFactory, twisted.web.guard.DigestCredentialFactory

View In Hierarchy

A credential factory defines a way to generate a particular kind of authentication challenge and a way to interpret the responses to these challenges. It creates ICredentials providers from responses. These objects will be used with twisted.cred to authenticate an authorize requests.

Attribute scheme A str giving the name of the authentication scheme with which this factory is associated. For example, 'basic' or 'digest'.
Method getChallenge Generate a new challenge to be sent to a client.
Method decode Create a credentials object from the given response.
scheme = (source)

A str giving the name of the authentication scheme with which this factory is associated. For example, 'basic' or 'digest'.

def getChallenge(request): (source)

Generate a new challenge to be sent to a client.

ParametersrequestThe request the response to which this challenge will be included. (type: twisted.web.http.Request)
ReturnsA mapping from str challenge fields to associated str values. (type: dict)
def decode(response, request): (source)

Create a credentials object from the given response.

Parametersresponsescheme specific response string (type: str)
requestThe request being processed (from which the response was taken). (type: twisted.web.http.Request)
ReturnsThe credentials represented by the given response. (type: twisted.cred.credentials.ICredentials provider)
Raisestwisted.cred.error.LoginFailedIf the response is invalid.
API Documentation for Twisted, generated by pydoctor 21.2.0 at 2021-02-28 21:00:42.