pub trait AuthenticationService<S: Subject>: Send + Sync {
    // Required methods
    fn header_name(&self) -> &str;
    fn cookie_name(&self) -> &str;
    fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        token: Option<&'life1 str>,
        cookie: Option<&'life2 str>
    ) -> Pin<Box<dyn Future<Output = Result<S>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Authentication service

Required Methods§

source

fn header_name(&self) -> &str

Header name containing the authentication header

source

fn cookie_name(&self) -> &str

Cookie name containing the authentication cookie

source

fn authenticate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, token: Option<&'life1 str>, cookie: Option<&'life2 str> ) -> Pin<Box<dyn Future<Output = Result<S>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Validates if the given token or cookie is valid and returns the authenticated subject

Implementors§