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
Source§impl IntoResponse for AuthError
impl IntoResponse for AuthError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
impl StructuralPartialEq for AuthError
Auto Trait Implementations§
impl Freeze for AuthError
impl RefUnwindSafe for AuthError
impl Send for AuthError
impl Sync for AuthError
impl Unpin for AuthError
impl UnwindSafe for AuthError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.