pub struct AuthFlow { /* private fields */ }Expand description
OAuth2 Authorization Code Flow
Implementations§
Source§impl AuthFlow
impl AuthFlow
Sourcepub fn new(provider: OAuthProvider, redirect_uri: &str) -> Self
pub fn new(provider: OAuthProvider, redirect_uri: &str) -> Self
Create a new auth flow
Generate authorization URL
Sourcepub async fn exchange_code(
&self,
code: &str,
state: &AuthState,
) -> Result<TokenSet>
pub async fn exchange_code( &self, code: &str, state: &AuthState, ) -> Result<TokenSet>
Exchange authorization code for tokens
Sourcepub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenSet>
pub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenSet>
Refresh access token
Auto Trait Implementations§
impl Freeze for AuthFlow
impl !RefUnwindSafe for AuthFlow
impl Send for AuthFlow
impl Sync for AuthFlow
impl Unpin for AuthFlow
impl !UnwindSafe for AuthFlow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more