AuthenticationProvider

Trait AuthenticationProvider 

Source
pub trait AuthenticationProvider {
    // Required methods
    fn name(&self) -> &str;
    fn initialize<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_auth_request<'life0, 'async_trait>(
        &'life0 self,
        request: AuthRequest,
    ) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn validate_credentials<'life0, 'life1, 'async_trait>(
        &'life0 self,
        credentials: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<ValidationResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_metadata<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<ProviderMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for server-side authentication providers

Required Methods§

Source

fn name(&self) -> &str

Provider name

Source

fn initialize<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize the provider

Source

fn handle_auth_request<'life0, 'async_trait>( &'life0 self, request: AuthRequest, ) -> Pin<Box<dyn Future<Output = Result<AuthResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle authentication request

Source

fn validate_credentials<'life0, 'life1, 'async_trait>( &'life0 self, credentials: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<ValidationResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate credentials

Source

fn get_metadata<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ProviderMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get provider metadata

Implementors§