Struct tlns_google_oauth2::GoogleOAuth2Client
source · pub struct GoogleOAuth2Client<'b> { /* private fields */ }
Expand description
A thin wrapper around oauth2
for Google OAuth2.
Implementations§
source§impl<'b> GoogleOAuth2Client<'b>
impl<'b> GoogleOAuth2Client<'b>
sourcepub fn new(
client_id: String,
client_secret: String,
redirect_uri: String,
) -> Result<Self, ParseError>
pub fn new( client_id: String, client_secret: String, redirect_uri: String, ) -> Result<Self, ParseError>
Create new crate::GoogleOAuth2Client
instance
Make a authorization URL for user to authenticate
csrf_token
will be default oauth2::CsrfToken::new_random
Scopes example will be
vec![&tlns_google_oauth2::scopes::GoogleOAuth2APIv2::AuthUserinfoProfile];
sourcepub async fn get_token(
&self,
auth_code: String,
) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>, String>
pub async fn get_token( &self, auth_code: String, ) -> Result<StandardTokenResponse<EmptyExtraTokenFields, BasicTokenType>, String>
Get authentication tokens from provider with authenticated code from Google
Auto Trait Implementations§
impl<'b> Freeze for GoogleOAuth2Client<'b>
impl<'b> RefUnwindSafe for GoogleOAuth2Client<'b>
impl<'b> Send for GoogleOAuth2Client<'b>
impl<'b> Sync for GoogleOAuth2Client<'b>
impl<'b> Unpin for GoogleOAuth2Client<'b>
impl<'b> UnwindSafe for GoogleOAuth2Client<'b>
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