pub trait AuthProvider: Send + Sync {
// Required methods
fn authenticate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
req: &'life1 Request<Bytes>,
cookies: &'life2 CookieJar,
backend: Option<&'life3 BackendManager>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthIdentity>, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn name(&self) -> &str;
// Provided method
fn priority(&self) -> i32 { ... }
}Expand description
Authentication provider trait.
Providers are run in priority order (highest first) until one returns an identity.
Required Methods§
Sourcefn authenticate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
req: &'life1 Request<Bytes>,
cookies: &'life2 CookieJar,
backend: Option<&'life3 BackendManager>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthIdentity>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
req: &'life1 Request<Bytes>,
cookies: &'life2 CookieJar,
backend: Option<&'life3 BackendManager>,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthIdentity>, AuthError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Attempt to authenticate the request.
Returns:
Ok(Some(identity))if credentials are validOk(None)if this provider doesn’t applyErr(...)if credentials are present but invalid
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".