This guide explains how to set up Google as an authentication provider with Stack Auth. Google OAuth2 allows users to sign in to your application using their Google account.
For Development purposes, Stack Auth uses shared keys for this provider. Shared keys are automatically created by Stack, but show Stack's logo on the OAuth sign-in page. You should replace these before you go into production.
Integration Steps
Create a Google OAuth2 App
- Navigate to the Google Cloud Console.
- Create a new project or select an existing one.
- In the sidebar, navigate to APIs & Services > Credentials.
- Click Create Credentials and select OAuth client ID.
- Select Web application as the application type.
- Enter a name for your OAuth client.
- Under Authorized redirect URIs, add
https://api.stack-auth.com/api/v1/auth/oauth/callback/google
- Click Create.
- Save the Client ID and Client Secret that are displayed.
Enable Google OAuth2 in Stack Auth
- On the Stack Auth dashboard, select Auth Methods in the left sidebar.
- Click Add SSO Providers and select Google as the provider.
- Set the Client ID and Client Secret you obtained from Google Cloud Console earlier.
Need More Help?
- Check the Google OAuth2 Documentation
- Join our Discord