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§
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 DenyAuthentication
impl Authentication for DenyAuthentication
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.
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.