Skip to main content

VerifierError

Enum VerifierError 

Source
#[non_exhaustive]
pub enum VerifierError {
Show 13 variants TokenMissing, TokenExpired, InvalidSignature { message: String, }, InvalidClaims { message: String, }, MetadataUnavailable { message: String, }, JwksUnavailable { message: String, }, TokenRevoked, InsufficientScope { required: String, available: Vec<String>, }, DpopProofMissing, DpopReplayDetected, DpopMultipleProofs, DpopBindingMismatch { message: String, }, DpopNotSupported,
}

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

TokenMissing

§

TokenExpired

§

InvalidSignature

Fields

§message: String
§

InvalidClaims

Fields

§message: String
§

MetadataUnavailable

Fields

§message: String
§

JwksUnavailable

Fields

§message: String
§

TokenRevoked

RFC 7662 §2.2 — introspection answered active: false for a token that had already passed local JWT verification.

RFC 7662 defines active: false broadly and authserver does not say why, so the token may be revoked — or the AS may not recognise this resource server as the token’s owner. Since authserver 0.1.2 only the issuing client or a runtime-client of the Resource named in aud gets a real answer; any other caller, including a public (secret-less) client, gets active: false for every token. If every token is rejected with this error, register the resource server’s client on the Resource: authserver admin resource runtime-client add --client-id <rs-client-id> --slug <resource-slug>.

The Display is deliberately bare: www_authenticate* copies error.to_string() into error_description and the mcp adapter copies it into the 401 body, so anything said here reaches an unauthenticated caller. The operator guidance above stays in the docs.

§

InsufficientScope

Fields

§required: String
§available: Vec<String>
§

DpopProofMissing

RFC 9449 §7 — the verify_with_context entrypoint received a DPoP-bound access token (one with cnf.jkt) but the request context carried no DPoP proof. Maps to the catalog’s error_category = "dpop_proof_missing" bucket.

A context that was never supplied is a different failure and is reported as Self::DpopBindingMismatch: verify takes no request context by construction, so “the caller passed one and it held no proof” is a claim only this entrypoint can make.

§

DpopReplayDetected

RFC 9449 §11.1 — the proof’s jti had already been observed by the configured replay store.

§

DpopMultipleProofs

RFC 9449 §4.3 #1 — the request carried more than one DPoP header, so there is no way to know which proof binds the request. Unlike the other DPoP failures this maps to error="invalid_dpop_proof" (RFC 9449 §7.1) rather than the generic invalid_token.

§

DpopBindingMismatch

Fields

§message: String
§

DpopNotSupported

RFC 9449 §6 — the resource has NOT opted into inbound DPoP (ResourceOptions::inbound_dpop is None), but the request carried a DPoP signal (a cnf.jkt-bound access token or a DPoP proof header). The verifier rejects rather than silently downgrading to bearer or applying ad-hoc defaults never advertised in PRM.

Implementations§

Source§

impl VerifierError

Source

pub fn is_dpop(&self) -> bool

true for any DPoP-specific variant. Currently DpopProofMissing, DpopReplayDetected, DpopMultipleProofs, DpopBindingMismatch, and DpopNotSupported.

Membership only — does NOT decide the WWW-Authenticate scheme. DpopNotSupported is a DPoP-flavoured error but the spec-correct retry scheme is Bearer (see Self::www_authenticate_scheme_is_dpop).

Source

pub fn www_authenticate_scheme_is_dpop(&self) -> bool

true when the spec-correct WWW-Authenticate challenge for this error uses the DPoP scheme (RFC 9449 §7.1) rather than the default Bearer (RFC 6750 §3).

All DPoP-bound failures map to DPoP except Self::DpopNotSupported, which is the carve-out: the client presented a DPoP signal against a resource that has not opted into DPoP, so there is no DPoP retry path on this resource — the correct challenge tells the client to retry as Bearer. Conformance fixtures assert this scheme byte-for-byte.

Trait Implementations§

Source§

impl Clone for VerifierError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VerifierError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for VerifierError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for VerifierError

Source§

impl Error for VerifierError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for VerifierError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for VerifierError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more