pub struct Google { /* private fields */ }Expand description
OAuth 2.0 provider implementation for Google.
Implements the Authorization Code flow with PKCE (S256). Default scopes are
openid, email, and profile. Override them via
OAuthProviderConfig::scopes.
Implementations§
Source§impl Google
impl Google
Sourcepub fn new(
config: &OAuthProviderConfig,
cookie_config: &CookieConfig,
key: &Key,
http_client: Client,
) -> Self
pub fn new( config: &OAuthProviderConfig, cookie_config: &CookieConfig, key: &Key, http_client: Client, ) -> Self
Creates a new Google provider from the given configuration.
cookie_config and key are used to sign the _oauth_state cookie that carries the
PKCE verifier and state nonce across the redirect. http_client is a
reqwest::Client used for the token exchange and user-info API calls.
Trait Implementations§
Source§impl OAuthProvider for Google
impl OAuthProvider for Google
Source§fn name(&self) -> &str
fn name(&self) -> &str
A stable, lowercase identifier for this provider (e.g.
"google", "github").Builds an authorization redirect response. Read more
Source§async fn exchange(
&self,
params: &CallbackParams,
state: &OAuthState,
) -> Result<UserProfile>
async fn exchange( &self, params: &CallbackParams, state: &OAuthState, ) -> Result<UserProfile>
Exchanges an authorization code for a
UserProfile. Read moreAuto Trait Implementations§
impl Freeze for Google
impl !RefUnwindSafe for Google
impl Send for Google
impl Sync for Google
impl Unpin for Google
impl UnsafeUnpin for Google
impl !UnwindSafe for Google
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