pub trait AuthMethod: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
credential: &'life1 Credential,
metadata: &'life2 CredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<MethodResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn validate_config(&self) -> Result<()>;
// Provided methods
fn supports_refresh(&self) -> bool { ... }
fn refresh_token<'life0, 'life1, 'async_trait>(
&'life0 self,
_refresh_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<AuthToken>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Trait for authentication methods.
Required Methods§
Sourcefn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
credential: &'life1 Credential,
metadata: &'life2 CredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<MethodResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
credential: &'life1 Credential,
metadata: &'life2 CredentialMetadata,
) -> Pin<Box<dyn Future<Output = Result<MethodResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate using the provided credentials.
Sourcefn validate_config(&self) -> Result<()>
fn validate_config(&self) -> Result<()>
Validate configuration for this method.
Provided Methods§
Sourcefn supports_refresh(&self) -> bool
fn supports_refresh(&self) -> bool
Check if this method supports refresh tokens.