pub enum OidcError {
NoKeycloak,
IdpUnavailable {
detail: String,
},
IssuerMismatch {
expected: String,
found: String,
},
SessionExpired,
AccessDenied,
DeviceCodeExpired,
PollTimeout {
waited_secs: u64,
},
EndpointUnavailable {
what: &'static str,
},
InsecureIssuer {
issuer: String,
},
EndpointOriginMismatch {
what: &'static str,
endpoint: String,
issuer: String,
},
Oauth {
error: String,
description: Option<String>,
},
Transport(String),
}Expand description
Failures of the login/refresh machinery. Every variant that a caller has
to behave differently about is its own variant; anything else collapses
into OidcError::Oauth (the IdP said no, with a code) or
OidcError::Transport (we never got a usable answer).
Variants§
NoKeycloak
/auth/public-config answered {"oidc_enabled": false}: this TraceVault
instance has no Keycloak at all, so interactive login is impossible and
an API key must be used instead. Permanent until an operator changes the
deployment. See fetch_public_config.
/auth/public-config answered a 5xx — the server, or an intermediary in
front of it, is unhealthy right now. Retryable, and explicitly NOT a
reason to go get an API key.
IssuerMismatch
The discovery document’s own issuer disagrees with the issuer the
server told us to use — a misconfiguration or a redirect to a
different realm. Both values are named so it is diagnosable.
SessionExpired
The refresh token is no longer accepted (invalid_grant).
AccessDenied
The user rejected the login in the browser.
DeviceCodeExpired
The device code expired before the user finished.
PollTimeout
We polled for the full expires_in budget without a verdict.
The issuer does not advertise an endpoint this operation needs.
InsecureIssuer
The issuer is not https (and not loopback), so the refresh token would
travel in clear text.
EndpointOriginMismatch
A discovery document named an endpoint on a different origin than the issuer’s — a misconfiguration, or an attempt to collect tokens elsewhere.
Oauth
An OAuth error code we don’t special-case.
Transport(String)
Network/HTTP-level failure, or a response we could not parse.
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()