#[non_exhaustive]pub enum CallbackError {
NoPendingAuthorization,
StateMismatch,
AuthorizationDenied {
error: String,
description: Option<String>,
},
MalformedCallback(&'static str),
TokenExchange(String),
ScopeNotCovered(ScopeNotCovered),
MissingRefreshToken,
TokenStore(String),
}Expand description
NativeAuthFlow::complete failure surface.
Every variant is terminal for the attempt that produced it; none is retryable with the same callback.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoPendingAuthorization
No authorization was pending — complete ran without a preceding
start, or a second callback arrived for an attempt already
consumed.
Load-bearing: the pending slot is taken unconditionally, before the state is compared, so a replayed callback lands here regardless of whether the first attempt succeeded. Single-use is the property; this variant is what it looks like from outside.
StateMismatch
The returned state did not match the pending one — the CSRF
defense (RFC 6749 §10.12). The attempt is consumed either way.
AuthorizationDenied
The authorization server redirected with an error instead of a code
(RFC 6749 §4.1.2.1) — most commonly access_denied, the user
declining at the consent screen.
Fields
MalformedCallback(&'static str)
The redirect query was neither a valid success nor a valid error
response — no code, no error, or no state.
TokenExchange(String)
The token endpoint rejected the exchange.
ScopeNotCovered(ScopeNotCovered)
The exchange succeeded but the granted scope does not cover the requested tier. Fails here, at sign-in, rather than an hour later on the first call that needs the missing atom.
MissingRefreshToken
The token response carried no refresh_token, so no durable
credential can be built from it. A native client that cannot renew
would silently sign the user out within the hour.
TokenStore(String)
The keystore rejected the write.
Trait Implementations§
Source§impl Debug for CallbackError
impl Debug for CallbackError
Source§impl Display for CallbackError
impl Display for CallbackError
Source§impl Error for CallbackError
impl Error for CallbackError
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()