[][src]Struct yup_oauth2::RefreshFlow

pub struct RefreshFlow<C> { /* fields omitted */ }

Implements the Outh2 Refresh Token Flow.

Refresh an expired access token, as obtained by any other authentication flow. This flow is useful when your Token is expired and allows to obtain a new and valid access token.

Methods

impl<C> RefreshFlow<C> where
    C: BorrowMut<Client>, 
[src]

pub fn new(client: C) -> RefreshFlow<C>[src]

pub fn refresh_token(
    &mut self,
    flow_type: FlowType,
    client_secret: &ApplicationSecret,
    refresh_token: &str
) -> &RefreshResult
[src]

Attempt to refresh the given token, and obtain a new, valid one. If the RefreshResult is RefreshResult::Error, you may retry within an interval of your choice. If it is RefreshResult:RefreshError, your refresh token is invalid or your authorization was revoked. Therefore no further attempt shall be made, and you will have to re-authorize using the DeviceFlow

Arguments

  • authentication_url - URL matching the one used in the flow that obtained your refresh_token in the first place.
  • client_id & client_secret - as obtained when registering your application
  • refresh_token - obtained during previous call to DeviceFlow::poll_token() or equivalent

Examples

Please see the crate landing page for an example.

Auto Trait Implementations

impl<C> Sync for RefreshFlow<C> where
    C: Sync

impl<C> Send for RefreshFlow<C> where
    C: Send

impl<C> Unpin for RefreshFlow<C> where
    C: Unpin

impl<C> !RefUnwindSafe for RefreshFlow<C>

impl<C> !UnwindSafe for RefreshFlow<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> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.