Skip to main content

refresh_over_http

Function refresh_over_http 

Source
pub async fn refresh_over_http<C: Connect>(
    connector: &C,
    configuration: &ConfigurationOpenApi,
    refresh: &RefreshToken,
) -> Result<TokenPair, ConnectorError>
Expand description

Exchanges a refresh token for a new pair at the token endpoint of the configuration.

The endpoint is reached through connector, which is the TLS connector outside tests. The old pair is invalid once this returns a new one.

ยงErrors

Returns ConnectorError::Token when the endpoint refuses the refresh or answers with something else than a token document, ConnectorError::Timeout when it does not answer within the timeout of the configuration, ConnectorError::Transport when the exchange fails, and ConnectorError::Config when the token URL has no usable host.