Skip to main content

exchange_code

Function exchange_code 

Source
pub async fn exchange_code(
    http: &Client,
    credentials: &Credentials,
    code: &str,
) -> Result<Token, Error>
Expand description

Exchange an authorization code for an access/refresh token pair.

This is step 3 of the OAuth2 flow. The code comes from the redirect URI query parameter after the user authorizes the application.

ยงErrors

Returns Error::Auth if the token exchange fails.