pub enum JwtValidationError {
Show 16 variants
Parse {
source: JwsParseError,
},
Signature {
source: VerifyError,
},
UnsignedToken,
DisallowedAlgorithm {
alg: String,
},
UnrecognizedCriticalHeader {
params: Vec<String>,
},
Expired {
expiration: SystemTime,
now: SystemTime,
},
NotYetValid {
not_before: SystemTime,
now: SystemTime,
},
IssuedInFuture {
issued_at: SystemTime,
now: SystemTime,
},
TokenTooOld {
issued_at: SystemTime,
max_token_age: Duration,
},
InvalidTokenType {
typ: Option<String>,
},
ClaimMismatch {
claim: &'static str,
expected: String,
actual: String,
},
RequiredClaimMissing {
claim: &'static str,
},
JtiTooLong {
len: usize,
max_len: usize,
},
JtiNotUnique,
JtiCheck {
source: Error,
},
ExtraClaims {
source: Error,
},
}Expand description
Validation errors that can occur while processing a JWT.
Variants§
Parse
The token could not be parsed as a compact JWS.
Fields
source: JwsParseErrorThe underlying error.
Signature
The token signature is invalid.
Fields
source: VerifyErrorThe underlying error.
UnsignedToken
The token is unsigned.
DisallowedAlgorithm
The token uses a disallowed signature algorithm.
UnrecognizedCriticalHeader
The token contains unrecognized critical header parameters.
Expired
The token is expired.
NotYetValid
The token is not yet valid.
IssuedInFuture
The token is issued in the future.
TokenTooOld
The token is too old.
Fields
issued_at: SystemTimeThe issued-at timestamp of the JWT.
InvalidTokenType
The token type claim is invalid.
ClaimMismatch
A claim did not match the expected value.
Fields
RequiredClaimMissing
A required claim is missing from the JWT.
JtiTooLong
The jti claim exceeds the maximum allowed length.
Fields
JtiNotUnique
The JTI was required to be unique, but was previously marked as seen.
JtiCheck
There was an internal failure when attempting to check for JTI uniqueness.
ExtraClaims
The token is structurally valid but does not contain the required extra claims.
Trait Implementations§
Source§impl Debug for JwtValidationError
impl Debug for JwtValidationError
Source§impl Display for JwtValidationError
impl Display for JwtValidationError
Source§impl Error for JwtValidationError
impl Error for JwtValidationError
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()
Source§impl ErrorCompat for JwtValidationError
impl ErrorCompat for JwtValidationError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read more