[][src]Trait yup_oauth2::GetToken

pub trait GetToken {
    fn token<I, T>(
        &mut self,
        scopes: I
    ) -> Box<dyn Future<Item = Token, Error = RequestError> + Send>
    where
        T: Into<String>,
        I: IntoIterator<Item = T>
;
fn api_key(&mut self) -> Option<String>;
fn application_secret(&self) -> ApplicationSecret; }

A provider for authorization tokens, yielding tokens valid for a given scope. The api_key() method is an alternative in case there are no scopes or if no user is involved.

Required methods

fn token<I, T>(
    &mut self,
    scopes: I
) -> Box<dyn Future<Item = Token, Error = RequestError> + Send> where
    T: Into<String>,
    I: IntoIterator<Item = T>, 

fn api_key(&mut self) -> Option<String>

fn application_secret(&self) -> ApplicationSecret

Return an application secret with at least token_uri, client_secret, and client_id filled in. This is used for refreshing tokens without interaction from the flow.

Loading content...

Implementors

impl<C: 'static> GetToken for ServiceAccountAccess<C> where
    C: Connect
[src]

fn application_secret(&self) -> ApplicationSecret[src]

Returns an empty ApplicationSecret as tokens for service accounts don't need to be refreshed (they are simply reissued).

impl<FD: FlowDelegate + 'static + Send + Clone, C: Connect + 'static> GetToken for InstalledFlow<FD, C>[src]

impl<FD: FlowDelegate + Clone + Send + 'static, C: Connect + Sync + 'static> GetToken for DeviceFlow<FD, C>[src]

impl<GT: 'static + GetToken + Send, S: 'static + TokenStorage + Send, AD: 'static + AuthenticatorDelegate + Send, C: 'static + Connect + Clone + Send> GetToken for Authenticator<GT, S, AD, C>[src]

fn api_key(&mut self) -> Option<String>[src]

Returns the API Key of the inner flow.

fn application_secret(&self) -> ApplicationSecret[src]

Returns the application secret of the inner flow.

Loading content...