JwtError
enum JwtError
A JWT error.
When a token doesn't have a valid JWT shape
When the Validation struct does not contain at least 1 algorithm
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 requestedWhen the decoding key doesn't match the
alg
in the headerWhen the encoding key doesn't match the
alg
in the headerWhen the signature doesn't match
When a claim required by the validation is not present
When the
exp
claim indicates that it has expiredWhen the
nbf
claim represents a time in the futureWhen the
sub
claim does not match one of the expected subject valuesWhen the
iss
claim does not match the expected issuerWhen the
aud
claim does not match one of the expected audience valuesWe could not sign with the given key
[src]
pub fn error(self): string {
switch (self) {
case .InvalidToken:
return "Invalid token";
case .MissingAlgorithm:
return "Missing algorithm";
case .InvalidAlgorithm:
return "Invalid algorithm";
case .MismatchedDecodingKey:
return "Mismatched decoding key";
case .MismatchedEncodingKey:
return "Mismatched encoding key";
case .InvalidSignature:
return "Invalid signature";
case .MissingRequiredClaim:
return "Missing required claim";
case .ExpiredSignature:
return "Expired signature";
case .ImmatureSignature:
return "Immature signature";
case .InvalidSubject:
return "Invalid subject";
case .InvalidIssuer:
return "Invalid issuer";
case .InvalidAudience:
return "Invalid audience";
case .FailedSigning:
return "Failed signing";
}
}
[src]
pub fn error(self): string {
switch (self) {
case .InvalidToken:
return "Invalid token";
case .MissingAlgorithm:
return "Missing algorithm";
case .InvalidAlgorithm:
return "Invalid algorithm";
case .MismatchedDecodingKey:
return "Mismatched decoding key";
case .MismatchedEncodingKey:
return "Mismatched encoding key";
case .InvalidSignature:
return "Invalid signature";
case .MissingRequiredClaim:
return "Missing required claim";
case .ExpiredSignature:
return "Expired signature";
case .ImmatureSignature:
return "Immature signature";
case .InvalidSubject:
return "Invalid subject";
case .InvalidIssuer:
return "Invalid issuer";
case .InvalidAudience:
return "Invalid audience";
case .FailedSigning:
return "Failed signing";
}
}