Exceptions
jwtlib.exceptions
Summary
Authentication and authorization exceptions.
This module defines the exception hierarchy used throughout the authentication library to represent authentication, authorization, and service-level failures.
All exceptions inherit from AuthError, allowing consumers to catch
authentication-related failures broadly or handle specific cases
selectively.
Classes
AuthError
Bases: Exception
Base authentication and authorization error.
Notes
Guarantees:
1 2 3 4 | |
AuthServiceUnavailable
Bases: AuthError
Raised when the authentication service cannot be reached.
Notes
Guarantees:
1 2 | |
InvalidAuthorizationHeader
Bases: AuthError
Raised when the Authorization header is missing or incorrectly
formatted.
Notes
Guarantees:
1 2 | |
InvalidToken
Bases: AuthError
Raised when a JWT is missing, malformed, expired, or invalid.
Notes
Guarantees:
1 2 | |
NotAuthenticated
Bases: AuthError
Raised when authentication is required but no user context is present.
Notes
Guarantees:
1 2 | |
UserNotFound
Bases: AuthError
Raised when a valid token does not map to an existing user.
Notes
Guarantees:
1 2 | |