Skip to main content

AuthProvider

Trait AuthProvider 

Source
pub trait AuthProvider: Send + Sync {
    // Required methods
    fn id(&self) -> &str;
    fn capabilities(&self) -> AuthCapabilities;
    fn begin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: AuthRequest,
        context: AuthContext<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<AuthProviderStep>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn continue_flow<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state: SecretString,
        response: AuthResponse,
        context: AuthContext<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<AuthProviderStep>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn refresh<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        session: &'life1 AuthSession,
        context: AuthContext<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<AuthSession>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn verify<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        session: &'life1 AuthSession,
        context: AuthContext<'life2>,
    ) -> Pin<Box<dyn Future<Output = Result<AuthSession>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn logout<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: AuthSession,
        context: AuthContext<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Stable compile-time extension contract for built-in and third-party providers.

Required Methods§

Source

fn id(&self) -> &str

Source

fn capabilities(&self) -> AuthCapabilities

Source

fn begin<'life0, 'life1, 'async_trait>( &'life0 self, request: AuthRequest, context: AuthContext<'life1>, ) -> Pin<Box<dyn Future<Output = Result<AuthProviderStep>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn continue_flow<'life0, 'life1, 'async_trait>( &'life0 self, state: SecretString, response: AuthResponse, context: AuthContext<'life1>, ) -> Pin<Box<dyn Future<Output = Result<AuthProviderStep>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn refresh<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session: &'life1 AuthSession, context: AuthContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<AuthSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn verify<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session: &'life1 AuthSession, context: AuthContext<'life2>, ) -> Pin<Box<dyn Future<Output = Result<AuthSession>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn logout<'life0, 'life1, 'async_trait>( &'life0 self, session: AuthSession, context: AuthContext<'life1>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§