pub trait AccessTokenProvider: ClientIdProvider {
    type Error: Display + Debug;

    fn access_token(&self) -> AccessToken;
    fn refresh_token<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; }
Expand description

A trait for an auth provider that can provide an access token.

Required Associated Types

Error type used for refreshing errors

Required Methods

Get the access token for this auth provider.

If the token is expired, this should return AccessToken::NeedsRefresh to indicate that AccessTokenProvider::refresh_token should be called

Refresh the token.

Implementors