pub enum OidcError {
}Expand description
Validation failure modes.
The matrix-relevant rejections (Expired, WrongIssuer,
WrongAudience, InvalidSignature, UnknownKeyId) are distinct
variants so backends can log precisely; all of them must collapse to
one generic auth failure on the wire (no oracle about why a token
was rejected). SessionValidator impls do this naturally by
returning None.
Variants§
Discovery(String)
Discovery document could not be fetched / parsed / trusted, and no
previously discovered jwks_uri was cached.
JWKS could not be fetched and no cached keys exist (cold cache + unreachable IdP). With a warm cache the validator degrades instead of erroring — see the module-level caching policy.
MissingKeyId
The token header carries no kid. The UT-S01 IdP contract is
“signs RS256 with kid”; kid-less tokens are rejected outright.
UnknownKeyId(String)
The token’s kid is not in the JWKS even after the policy’s one
unconditional refresh.
UnsupportedAlgorithm(String)
The token’s alg is not RS256 (RS256-only posture; the EdDSA
extension lands here and in jwks::admit_key).
InvalidSignature
Signature verification failed (tampered or foreign-key token).
Expired
exp is in the past. Zero leeway — no grace (AUTH-8), online or
offline.
WrongIssuer
iss does not match the configured issuer.
WrongAudience
aud does not match the configured audience.
NotYetValid
nbf is in the future (zero leeway; IDENTITY-27).
IssuedInFuture
iat is in the future (zero leeway).
MalformedToken(String)
The token is structurally broken (not a JWT, undecodable claims, missing required claims).
InvalidTenantClaim(TenantError)
The token carried an org_id claim that fails TenantId
validation. Rejected rather than treated as tenantless: a
malformed tenant claim must not silently widen (or collapse) the
caller’s isolation scope.
Trait Implementations§
Source§impl Error for OidcError
impl Error for OidcError
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
use the Display impl or to_string()