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§
Sourcefn exchange_code(
&self,
config: &OAuthClientConfig,
code: &str,
code_verifier: &str,
) -> Result<OAuthTokenResponse, SecurityError>
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".