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
decodeor the encoding/decoding key used doesn't match the alg requestedWhen the decoding key doesn't match the
algin the headerWhen the encoding key doesn't match the
algin the headerWhen the signature doesn't match
When a claim required by the validation is not present
When the
expclaim indicates that it has expiredWhen the
nbfclaim represents a time in the futureWhen the
subclaim does not match one of the expected subject valuesWhen the
issclaim does not match the expected issuerWhen the
audclaim 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";
}
}