Skip to main content

TokenExchanger

Trait TokenExchanger 

Source
pub trait TokenExchanger: Send + Sync {
    // Required method
    fn exchange_code(
        &self,
        config: &OAuthClientConfig,
        code: &str,
        code_verifier: &str,
    ) -> Result<OAuthTokenResponse, SecurityError>;
}
Expand description

Sync token exchange. Apps implement this with their HTTP stack.

Required Methods§

Source

fn exchange_code( &self, config: &OAuthClientConfig, code: &str, code_verifier: &str, ) -> Result<OAuthTokenResponse, SecurityError>

POSTs the authorization code to the token endpoint.

§Errors

Returns SecurityError::OAuth (or SecurityError::Authentication) on failure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§