[−][src]Struct yup_oauth2::RefreshFlow
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]
C: BorrowMut<Client>,
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]
&mut self,
flow_type: FlowType,
client_secret: &ApplicationSecret,
refresh_token: &str
) -> &RefreshResult
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 applicationrefresh_token
- obtained during previous call toDeviceFlow::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,
C: Sync,
impl<C> Send for RefreshFlow<C> where
C: Send,
C: Send,
impl<C> Unpin for RefreshFlow<C> where
C: Unpin,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,