Authenticator

Trait Authenticator 

Source
pub trait Authenticator: Send + Sync {
    // Required methods
    fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        req: &'life1 AuthnRequest<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Identity>, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn challenge(&self) -> String;
}
Expand description

One pluggable authenticator (dyn-compatible seam). Ok(None) is Anonymous; Err(AuthError::Invalid(..)) means a credential was PRESENTED and rejected.

Required Methods§

Source

fn authenticate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, req: &'life1 AuthnRequest<'life2>, ) -> Pin<Box<dyn Future<Output = Result<Option<Identity>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn challenge(&self) -> String

The WWW-Authenticate challenge value for 401 responses, built from the schemes this authenticator actually interprets. Client certificates are deliberately NOT challenged here: TLS-level client-auth has no WWW-Authenticate representation.

Implementors§