pub enum AuthError {
InvalidToken,
InvalidSignature,
MissingRequiredClaim(String),
ExpiredSignature,
InvalidIssuer,
InvalidAudience,
InvalidSubject,
ImmatureSignature,
InvalidAlgorithm,
MissingAlgorithm,
MissingToken,
InternalError,
}Expand description
An enum representing the possible errors that can occur when authenticating a request.
These are sourced from the jsonwebtoken crate and defined here to implement IntoResponse for
use in the axum framework.
Variants§
InvalidToken
When the token is invalid
InvalidSignature
When the signature is invalid
MissingRequiredClaim(String)
When a claim required by the validation is not present
ExpiredSignature
When a token’s exp claim indicates that it has expired
InvalidIssuer
When a token’s iss claim does not match the expected issuer
InvalidAudience
When a token’s aud claim does not match one of the expected audience values
InvalidSubject
When a token’s sub claim does not match one of the expected subject values
ImmatureSignature
When a token’s nbf claim represents a time in the future
InvalidAlgorithm
When the algorithm in the header doesn’t match the one passed to decode or the encoding/decoding key
used doesn’t match the alg requested
MissingAlgorithm
When the Validation struct does not contain at least 1 algorithm
MissingToken
When the request is missing a token
InternalError
When an internal error occurs that doesn’t fit into the other categories. This is a catch-all error for any unexpected errors that occur such as network errors, decoding errors, and cryptographic errors.