pub trait GetToken:
GetTokenClone
+ Send
+ Sync {
// Required method
fn get_token<'a>(
&'a self,
_scopes: &'a [&str],
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>;
}
Required Methods§
sourcefn get_token<'a>(
&'a self,
_scopes: &'a [&str],
) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>
fn get_token<'a>( &'a self, _scopes: &'a [&str], ) -> Pin<Box<dyn Future<Output = Result<Option<String>, Box<dyn Error + Send + Sync>>> + Send + 'a>>
Called whenever an API call requires authentication via an oauth2 token.
Returns Ok(None)
if a token is not necessary - otherwise, returns an error
indicating the reason why a token could not be produced.