pub struct AuthenticatorChain<T>where
T: Authenticator,{ /* private fields */ }Expand description
Chain multiple authenticators together.
The first authenticator that returns true for Authenticator::can_handle_token() will be used
to authenticate the token.
We strongly recommend setting different idp_ids
for authenticators. Subject ids between different IdPs can overlap.
Implementations§
Source§impl<T: Authenticator> AuthenticatorChain<T>
impl<T: Authenticator> AuthenticatorChain<T>
pub fn builder() -> AuthenticatorChainBuilder<T>
Trait Implementations§
Source§impl<T> Authenticator for AuthenticatorChain<T>where
T: Authenticator,
impl<T> Authenticator for AuthenticatorChain<T>where
T: Authenticator,
Source§async fn authenticate(&self, token: &str) -> Result<Authentication>
async fn authenticate(&self, token: &str) -> Result<Authentication>
Authenticate a token. This must validate the tokens signature and claims.
For opaque tokens, handlers may connect to the
IdP to validate the token. Read moreSource§fn idp_id(&self) -> Option<&String>
fn idp_id(&self) -> Option<&String>
Returns an id that uniquely identifies the
IdP this authenticator is for.Source§fn can_handle_token(
&self,
token: &str,
introspection_result: &IntrospectionResult,
) -> bool
fn can_handle_token( &self, token: &str, introspection_result: &IntrospectionResult, ) -> bool
Check if the authenticator can handle the token.
This is used in the
AuthenticatorChain to determine which authenticator to use.
This should be a quick check that doesn’t involve cryptographic operations.Source§impl<T> Clone for AuthenticatorChain<T>where
T: Authenticator + Clone,
impl<T> Clone for AuthenticatorChain<T>where
T: Authenticator + Clone,
Source§fn clone(&self) -> AuthenticatorChain<T>
fn clone(&self) -> AuthenticatorChain<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for AuthenticatorChain<T>
impl<T> RefUnwindSafe for AuthenticatorChain<T>where
T: RefUnwindSafe,
impl<T> Send for AuthenticatorChain<T>
impl<T> Sync for AuthenticatorChain<T>
impl<T> Unpin for AuthenticatorChain<T>where
T: Unpin,
impl<T> UnwindSafe for AuthenticatorChain<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more