pub enum AuthorizeError {
Discovery {
what: &'static str,
reason: String,
},
ResourceMismatch {
expected: String,
found: String,
},
NoPkce,
NoRegistration,
Registration(String),
CredentialsForAnotherIssuer {
registered: String,
named: String,
},
Begin(BeginError),
Callback(CallbackError),
Redeem(RedeemError),
Environment(EnvironmentError),
Metadata(MetadataError),
AttemptsExhausted(u32),
}Expand description
Why a token could not be obtained.
Variants§
Discovery
A document the flow needs could not be read.
ResourceMismatch
The resource metadata describes a different resource than the one asked.
Following it would send the user to authorize access to something other than the server they are using.
NoPkce
The authorization server does not offer PKCE with S256.
“MCP clients MUST verify PKCE support”: a server that does not list it, or does not list the method, is refused rather than assumed.
NoRegistration
No way to obtain a client id: nothing pre-registered, no metadata document the server supports, no registration endpoint.
Registration(String)
Dynamic client registration was refused or unreadable.
CredentialsForAnotherIssuer
Pre-registered credentials exist for a different authorization server.
Fields
Begin(BeginError)
The authorization request could not be built.
Callback(CallbackError)
The callback was refused.
Redeem(RedeemError)
The code could not be redeemed.
Environment(EnvironmentError)
The environment could not do something the flow asked.
Metadata(MetadataError)
A metadata document was unusable.
AttemptsExhausted(u32)
The server kept refusing, and the client stopped asking.
Trait Implementations§
Source§impl Debug for AuthorizeError
impl Debug for AuthorizeError
Source§impl Display for AuthorizeError
impl Display for AuthorizeError
Source§impl Error for AuthorizeError
impl Error for AuthorizeError
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()