pub enum OauthError {
NeedsReauth(String),
StateInvalid(String),
ResourceMismatch(String),
IssuerMismatch(String),
UnsupportedMethod(String),
Internal(String),
}Expand description
Stable error kinds for upstream OAuth flows.
These must be kept in sync with docs/dev/ERRORS.md.
Variants§
NeedsReauth(String)
Refresh token was rejected (invalid_grant) or decryption failed after key
rotation. User must re-initiate the authorization flow.
StateInvalid(String)
Callback state is missing, expired, replayed, or bound to a different subject / upstream.
ResourceMismatch(String)
Upstream AS refused the resource parameter or issued a token with the
wrong audience (RFC 8707).
IssuerMismatch(String)
AS metadata issuer did not match the discovered AS URL (RFC 8414 §3.3).
UnsupportedMethod(String)
AS only offered plain PKCE or omitted code_challenge_methods_supported.
Internal(String)
Internal / configuration errors that are not caller-recoverable.
Implementations§
Source§impl OauthError
impl OauthError
Sourcepub const fn http_status_code(&self) -> u16
pub const fn http_status_code(&self) -> u16
Transport-neutral HTTP status code for this error.
Returns a bare u16 rather than axum::http::StatusCode so the upstream
OAuth runtime carries no transport dependency; the product binary maps it
onto its own response type at the route boundary.
Trait Implementations§
Source§impl Debug for OauthError
impl Debug for OauthError
Source§impl Display for OauthError
impl Display for OauthError
Source§impl Error for OauthError
impl Error for OauthError
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()