pub struct OAuth2Client { /* private fields */ }Expand description
OAuth2 client
Implementations§
Source§impl OAuth2Client
impl OAuth2Client
pub fn new(config: OAuth2Config) -> Self
Generate authorization URL with PKCE
Sourcepub async fn exchange_code(
&self,
code: &str,
code_verifier: Option<&str>,
) -> Result<TokenResponse>
pub async fn exchange_code( &self, code: &str, code_verifier: Option<&str>, ) -> Result<TokenResponse>
Exchange authorization code for access token
Sourcepub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenResponse>
pub async fn refresh_token(&self, refresh_token: &str) -> Result<TokenResponse>
Refresh access token
Auto Trait Implementations§
impl Freeze for OAuth2Client
impl !RefUnwindSafe for OAuth2Client
impl Send for OAuth2Client
impl Sync for OAuth2Client
impl Unpin for OAuth2Client
impl UnsafeUnpin for OAuth2Client
impl !UnwindSafe for OAuth2Client
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more