Go to the latest version of this document.

# ``twisted`.`mail`.`interfaces`.`IChallengeResponse``

interface documentation

`class IChallengeResponse(Interface): (source)`

Known implementations: `twisted.mail._cred.LOGINCredentials`, `twisted.mail._cred.PLAINCredentials`

View In Hierarchy

An `IMAPrev4` authorization challenge mechanism.

Method | `getChallenge` | Return a client challenge.
Method | `moreChallenges` | Are there more challenges than just the first? If so, callers should challenge clients with the result of `getChallenge`, and check their response with `setResponse` in a loop until this returns `False`
Method | `setResponse` | Extract a username and possibly a password from a response and assign them to `username` and `password` instance variables.

def getChallenge(): (source)

Return a client challenge.

Returns
`bytes` | A challenge.

def moreChallenges(): (source)

Are there more challenges than just the first? If so, callers should challenge clients with the result of `getChallenge`, and check their response with `setResponse` in a loop until this returns `False`

Returns
`bool` | Are there more challenges?

def setResponse(response): (source)

Extract a username and possibly a password from a response and assign them to `username` and `password` instance variables.

Parameters
response:`bytes` | A decoded response.

See Also
`credentials.IUsernamePassword` or `credentials.IUsernameHashedPassword`