Skip to content

AuthXException#

authx.exceptions.AuthXException #

Bases: Exception

Base AuthXException Exception

The base exception for all AuthX exceptions.

authx.exceptions.BadConfigurationError #

Bases: AuthXException

Exception raised when AuthX configuration contains wrong parameters

Raised when AuthX configuration contains wrong parameters.

authx.exceptions.JWTDecodeError #

Bases: AuthXException

Exception raised when decoding JSON Web Token fails

Raised when decoding JSON Web Token fails.

authx.exceptions.NoAuthorizationError #

Bases: AuthXException

Exception raised when no token can be parsed from request

Raised when no token can be parsed from request.

authx.exceptions.CSRFError #

Bases: AuthXException

Exception raised when CSRF protection failed

Raised when CSRF protection failed.

authx.exceptions.TokenError #

Bases: AuthXException

Base Exception for token related errors

Raised when token is invalid.

authx.exceptions.MissingTokenError #

Bases: TokenError

Exception raised when no token can be parsed from request

Raised when no token can be parsed from request.

authx.exceptions.MissingCSRFTokenError #

Bases: MissingTokenError

Exception raised when no CSRF token can be parsed from request

Raised when no CSRF token can be parsed from request.

authx.exceptions.TokenTypeError #

Bases: TokenError

Exception raised when a specific token type is expected

Raised when token type is invalid.

authx.exceptions.RevokedTokenError #

Bases: TokenError

Exception raised when a revoked token has been used

Raised when token is invalid.

authx.exceptions.TokenRequiredError #

Bases: TokenError

Exception raised when no token was used in request

Raised when token is required.

authx.exceptions.FreshTokenRequiredError #

Bases: TokenError

Exception raised when a not fresh token was used in request

Raised when fresh token is required.

authx.exceptions.AccessTokenRequiredError #

Bases: TokenTypeError

Exception raised when an access token is missing from request

Raised when access token is required.

authx.exceptions.RefreshTokenRequiredError #

Bases: TokenTypeError

Exception raised when an refresh token is missing from request

Raised when refresh token is required.

authx.exceptions.InvalidToken #

InvalidToken(errors)

Bases: Exception

When a token is invalid for all identity providers

Initialize InvalidToken Exception

PARAMETER DESCRIPTION
errors

TYPE: str

PARAMETER DESCRIPTION
errors

List of errors

TYPE: List[str]

Source code in authx/exceptions.py
def __init__(self, errors: str) -> None:
    """Initialize InvalidToken Exception

    Args:
        errors (List[str]): List of errors
    """
    self.errors = errors

errors instance-attribute #

errors = errors
 Raised when token is invalid.