Google

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

  1. Navigate to the Google Cloud Console.
  2. Create a new project or select an existing one.
  3. In the sidebar, navigate to APIs & Services > Credentials.
  4. Click Create Credentials and select OAuth client ID.
  5. Select Web application as the application type.
  6. Enter a name for your OAuth client.
  7. Under Authorized redirect URIs, add https://api.stack-auth.com/api/v1/auth/oauth/callback/google
  8. Click Create.
  9. Save the Client ID and Client Secret that are displayed.

Enable Google OAuth2 in Stack Auth

  1. On the Stack Auth dashboard, select Auth Methods in the left sidebar.
  2. Click Add SSO Providers and select Google as the provider.
  3. Set the Client ID and Client Secret you obtained from Google Cloud Console earlier.

Need More Help?

Stack Auth AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details.

For the most accurate information, please join our Discord or email us.

How can I help?

Ask me about Stack Auth while you browse the docs.