3.6 KiB
3.6 KiB
title, description, url
| title | description | url |
|---|---|---|
| Configure "Sign in with Google" for your mobile application. | /docs/mobile/auth/oauth/google |
"Sign in with Google" enables a fast account-chooser experience on mobile (especially on Android). Configure your platform credentials, prompt the native account picker, then exchange the returned token on your backend to create a session with your auth server.
On Android, Google Sign‑In uses [Google Identity Services](https://developers.google.com/identity?hl=pl) and integrates with the system account chooser. On iOS, the recommended Expo flow uses [expo-auth-session](https://docs.expo.dev/versions/latest/sdk/auth-session/) with Google for a native, web-based sign-in experience.Why use Google authentication?
Account picker and token storage integrated with the OS for speed and familiarity. Android native chooser; iOS polished experience via Expo. Tokens are verified server-side with [Better Auth](https://www.better-auth.com/docs/authentication/google) before a session is issued. Reduce friction with one-tap sign-in and fewer passwords to remember. Built on [Google Identity Services](https://developers.google.com/identity?hl=pl) and best-practice OAuth flows.Requirements
- Configure Google Cloud OAuth Client IDs (Android package + SHA-1, iOS bundle ID) in the Google Cloud Console
- Build with EAS to ensure native credentials are embedded correctly
- Add your app deep link scheme to the auth server's trusted origins configuration
Check the Better Auth documentation and @react-native-google-signin/google-signin documentation for steps to configure your server verification, client IDs and more.
High-level flow
- Configure Google OAuth Client IDs for Android and iOS in Google Cloud Console.
- Initialize the Google auth request in your app and render a "Sign in with Google" button.
- Prompt the account chooser; on success you receive an
idTokenand/oraccessToken. - Send the tokens to the API powered by Better Auth to verify and establish a session.
- Persist the session and proceed to the app.
For a more in-depth overview of Google authentication, including implementation details, platform caveats, and advanced configuration, see the following resources:
