Skip to main content

exchange_client_credentials

Function exchange_client_credentials 

Source
pub async fn exchange_client_credentials(
    token_url: &str,
    client_id: &str,
    client_secret: &str,
    scopes: &[String],
) -> Result<String>
Expand description

Exchange client credentials for an access token (OAuth 2.0 Client Credentials flow).

Sends a POST to token_url with:

grant_type=client_credentials&client_id=...&client_secret=...&scope=...

Returns the raw access_token string on success.