#[non_exhaustive]pub enum JwtValidationError {
Show 15 variants
Jws(JwsError),
DisallowedAlgorithm(JwsAlgorithm),
UnexpectedTyp {
expected: String,
found: Option<String>,
},
Payload(Error),
KeyReference(KeyReferenceError),
KeyResolution {
key: Box<KeyReference>,
source: KeyResolutionError,
},
Signature(VerificationError),
KeyNotIssuers {
issuer: Option<String>,
key: Box<KeyReference>,
},
IssuerMismatch {
expected: String,
found: Option<String>,
},
AudienceMismatch {
expected: String,
found: Option<OneOrMany<String>>,
},
Expired {
expired_at: i64,
now: i64,
},
NotYetValid {
not_before: i64,
now: i64,
},
IssuedInFuture {
issued_at: i64,
now: i64,
},
MissingClaim(String),
Claims(Error),
}Expand description
Why a JWT did not pass JwtValidator::validate.
Times are NumericDate seconds since the Unix epoch.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Jws(JwsError)
The token is not a compact JWS this crate decodes.
DisallowedAlgorithm(JwsAlgorithm)
The header alg is not one the options accept.
UnexpectedTyp
The header typ is not the one the options require, or is missing.
Payload(Error)
The payload is not a JSON claims set; the source is the JSON error.
KeyReference(KeyReferenceError)
The header names no key this crate can look for.
KeyResolution
The key the token names could not be resolved.
Fields
key: Box<KeyReference>Where the token says its key is.
source: KeyResolutionErrorWhat went wrong.
Signature(VerificationError)
The signature does not verify under the resolved key.
KeyNotIssuers
The key that signed the token does not belong to its iss.
Fields
key: Box<KeyReference>Where the token says its key is.
IssuerMismatch
iss is not the expected issuer.
AudienceMismatch
aud does not include the expected audience.
Expired
The token has expired.
NotYetValid
The token is not valid yet.
IssuedInFuture
The token claims to have been issued in the future.
MissingClaim(String)
A claim the options require is missing.
Claims(Error)
The claims do not fit the type JwtValidator::validate_as reads them into; the source
is the JSON error.
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()