Responses

from aioauth import responses

Response objects used throughout the project.


class ErrorResponse(error: Literal['invalid_request', 'invalid_client', 'invalid_grant', 'invalid_scope', 'unauthorized_client', 'unsupported_grant_type', 'unsupported_response_type', 'unsupported_token_type', 'insecure_transport', 'mismatching_state', 'method_is_not_allowed', 'server_error', 'temporarily_unavailable'], description: str, error_uri: str = '')[source]

Response for errors.

error: Literal['invalid_request', 'invalid_client', 'invalid_grant', 'invalid_scope', 'unauthorized_client', 'unsupported_grant_type', 'unsupported_response_type', 'unsupported_token_type', 'insecure_transport', 'mismatching_state', 'method_is_not_allowed', 'server_error', 'temporarily_unavailable']
description: str
error_uri: str = ''
class AuthorizationCodeResponse(code: str, scope: str)[source]

Response for authorization_code.

Used by aioauth.response_type.ResponseTypeAuthorizationCode.

code: str
scope: str
class NoneResponse[source]

Response for aioauth.response_type.ResponseTypeNone.

See: OAuth v2 multiple response types,

class TokenResponse(expires_in: int, refresh_token_expires_in: int, access_token: str, refresh_token: str, scope: str, token_type: str = 'Bearer')[source]

Response for valid token.

Used by aioauth.response_type.ResponseTypeToken.

expires_in: int
refresh_token_expires_in: int
access_token: str
refresh_token: str
scope: str
token_type: str = 'Bearer'
class IdTokenResponse(id_token: str)[source]

Response for OpenID id_token.

Used by aioauth.response_type.ResponseResponseTypeIdTokenTypeToken.

id_token: str
class TokenActiveIntrospectionResponse(scope: str, client_id: str, token_type: Literal['access_token', 'refresh_token'], expires_in: int, active: bool = True)[source]

Response for a valid access token.

Used by aioauth.server.AuthorizationServer.create_token_introspection_response().

scope: str
client_id: str
token_type: Literal['access_token', 'refresh_token']
expires_in: int
active: bool = True
class TokenInactiveIntrospectionResponse(active: bool = False)[source]

For an invalid, revoked or expired token.

Used by aioauth.server.AuthorizationServer.create_token_introspection_response().

active: bool = False
class Response(content: ~typing.Dict = <factory>, status_code: ~http.HTTPStatus = HTTPStatus.OK, headers: ~aioauth.collections.HTTPHeaderDict = <factory>)[source]

General response class.

Used by aioauth.server.AuthorizationServer.

content: Dict
status_code: HTTPStatus = 200
headers: HTTPHeaderDict