pub enum AuthError {
InvalidToken,
InvalidSignature,
MissingRequiredClaim(String),
ExpiredSignature,
InvalidIssuer,
InvalidAudience,
InvalidSubject,
ImmatureSignature,
InvalidAlgorithm,
MissingAlgorithm,
MissingToken,
InternalError,
}Expand description
Authentication errors that can occur during JWT extraction and validation.
These errors are returned by the Claims extractor and mapped to appropriate HTTP responses.
Variants§
InvalidToken
The JWT token format is invalid or malformed.
InvalidSignature
The JWT signature verification failed.
MissingRequiredClaim(String)
A required JWT claim is missing from the token.
ExpiredSignature
The token’s exp claim indicates it has expired.
InvalidIssuer
The token’s iss claim does not match the expected issuer.
InvalidAudience
The token’s aud claim does not match the expected audience.
InvalidSubject
The token’s sub claim does not match the expected subject.
ImmatureSignature
The token’s nbf claim indicates it is not yet valid.
InvalidAlgorithm
The algorithm specified in the token header is not allowed.
MissingAlgorithm
No validation algorithms were configured.
MissingToken
No JWT token was found in the request.
InternalError
An unexpected internal error occurred (network, decoding, or cryptographic errors).
Trait Implementations§
Source§impl Error for AuthError
impl Error for AuthError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()