Expand description
Google sign-in in the browser, for desktop apps: OAuth 2.0 for installed apps with a loopback redirect and PKCE (S256). Not available on wasm.
GoogleSignIn::startlistens on127.0.0.1at a random port and builds the authorization URL.- The app opens
GoogleSignIn::authorization_urlin the browser (or calls [open_browser] with theopen-browserfeature). GoogleSignIn::finishwaits for the redirect, answers the browser with a “you can close this window” page, and exchanges the code for tokens.
The ID token then signs in to the cloud with
crate::CloudClient::sign_in_with_google_id_token.
Structs§
- Google
Desktop Config - A Google OAuth client of type “Desktop app”. Its secret is not confidential for installed apps, but it is still the caller’s to supply.
- Google
Sign In - A sign-in waiting for the browser.
- Google
Tokens - Tokens from Google.
id_tokenis what the cloud wants. - Sign
InCanceller - Cancels a pending sign-in from anywhere:
GoogleSignIn::finishthen fails withError::Cancelled.
Constants§
- DEFAULT_
SIGN_ IN_ TIMEOUT - How long
GoogleSignIn::finishwaits for the user by default. - GOOGLE_
AUTH_ URL - GOOGLE_
TOKEN_ URL