[][src]Struct yup_oauth2::InstalledFlow

pub struct InstalledFlow<FD: FlowDelegate, C: Connect + 'static> { /* fields omitted */ }

InstalledFlow provides tokens for services that follow the "Installed" OAuth flow. (See https://www.oauth.com/oauth2-servers/authorization/, https://developers.google.com/identity/protocols/OAuth2InstalledApp). You should use it wrapped inside an Authenticator to benefit from refreshing tokens and caching previously obtained authorization.

Methods

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

pub fn new(
    client: Client<C, Body>,
    fd: FD,
    secret: ApplicationSecret,
    method: InstalledFlowReturnMethod
) -> InstalledFlow<FD, C>
[src]

Starts a new Installed App auth flow. If HTTPRedirect is chosen as method and the server can't be started, the flow falls back to Interactive.

pub fn obtain_token<'a>(
    &mut self,
    scopes: Vec<String>
) -> impl 'a + Future<Item = Token, Error = RequestError> + Send
[src]

Handles the token request flow; it consists of the following steps: . Obtain a authorization code with user cooperation or internal redirect. . Obtain a token and refresh token using that code. . Return that token

It's recommended not to use the DefaultFlowDelegate, but a specialized one.

Trait Implementations

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

Auto Trait Implementations

impl<FD, C> Sync for InstalledFlow<FD, C> where
    FD: Sync

impl<FD, C> Send for InstalledFlow<FD, C> where
    FD: Send

impl<FD, C> Unpin for InstalledFlow<FD, C> where
    FD: Unpin

impl<FD, C> !RefUnwindSafe for InstalledFlow<FD, C>

impl<FD, C> !UnwindSafe for InstalledFlow<FD, C>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T