pub trait Authentication: Send + Sync {
    type Item;

    // Required method
    fn authenticate<'life0, 'async_trait>(
        &'life0 self,
        credentials: Option<(String, String)>
    ) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Use this trait to handle a custom authentication on your end.

Required Associated Types§

Required Methods§

source

fn authenticate<'life0, 'async_trait>( &'life0 self, credentials: Option<(String, String)> ) -> Pin<Box<dyn Future<Output = Option<Self::Item>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl Authentication for AcceptAuthentication

§

type Item = ()

source§

impl Authentication for DenyAuthentication

§

type Item = ()

source§

impl Authentication for SimpleUserPassword

This is an example to auth via simple credentials. If the auth succeed, we return the username authenticated with, for further uses.