Skip to main content

TokenExchanger

Trait TokenExchanger 

Source
pub trait TokenExchanger: Send + Sync {
    // Required method
    fn exchange(
        &self,
        token_url: &str,
        code: &str,
        code_verifier: &str,
        client_id: &str,
    ) -> Result<Value>;
}
Expand description

Exchanges an authorization code for OIDC tokens at the provider’s token endpoint. The HTTP implementation belongs to the service slice; tests inject closures.

Required Methods§

Source

fn exchange( &self, token_url: &str, code: &str, code_verifier: &str, client_id: &str, ) -> Result<Value>

The token response as a raw JSON value (the caller validates it via the kit’s OIDC validator).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<F> TokenExchanger for F
where F: Fn(&str, &str, &str, &str) -> Result<Value> + Send + Sync,