pub trait AuthenticationEngine:
Debug
+ Send
+ Sync
+ 'static {
// Required methods
fn authorize<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<AuthorizeData, AuthenticationEngineError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn callback<'life0, 'async_trait>(
&'life0 self,
callback_params: CallbackRequestParams,
persisted_data: OidcSessionPersisted,
) -> Pin<Box<dyn Future<Output = Result<User, AuthenticationEngineError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Defines the functionality that needs to be implemented for the application to perform OIDC authentication.
Required Methods§
Called as part of the OIDC /authorize endpoint.
Sourcefn callback<'life0, 'async_trait>(
&'life0 self,
callback_params: CallbackRequestParams,
persisted_data: OidcSessionPersisted,
) -> Pin<Box<dyn Future<Output = Result<User, AuthenticationEngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn callback<'life0, 'async_trait>(
&'life0 self,
callback_params: CallbackRequestParams,
persisted_data: OidcSessionPersisted,
) -> Pin<Box<dyn Future<Output = Result<User, AuthenticationEngineError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
After authentication, the IdP would redirect the user agent to the callback route. This would handle the finalizing the OIDC flow to return the validated user.
The persisted_data would be extracted from the web session; it
should have been stored as part of the /authorize endpoint. The
callback_params would have come from the query params of the callback
handler.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".