Auto Tournament
Sign-in

Google

Turn on Sign in with Google.

Users sign in with their Google account. Auto Tournament asks Google for the openid, email and profile scopes. It identifies the account by its Google account ID, not the email address. See Sign-in providers for how accounts and admin access work.

Google only accepts redirect URIs on a public domain with https://, or on http://localhost. A LAN address such as http://192.168.1.50:3069 does not work. Use a domain with HTTPS, see Reverse proxy.

Create an OAuth client in Google Cloud

  1. Open the Google Cloud console and sign in.
  2. In the project picker at the top, select a project or click New project, give it a name and click Create.
  3. Open the menu, then Google Auth Platform (under APIs & Services in some accounts). If you see Get started, click it and fill in:
    • App name: for example Auto Tournament. Users see this name when they sign in.
    • User support email: your email.
    • Audience: External.
    • Contact information: your email.
    • Agree to the Google API Services User Data Policy, then click Create.
  4. Click Clients in the left menu, then Create client.
  5. Set Application type to Web application and enter a Name, for example Auto Tournament.
  6. Add the redirect URI from the next step, then click Create.
  7. Copy the Client ID and the Client secret from the dialog. Download the JSON file too if you want a copy. You may not be able to see the secret again later.

Set the redirect URI

Under Authorized redirect URIs, click Add URI and enter:

FRONTEND_BASE_URL/api/auth/google/callback

For example https://tournament.example.com/api/auth/google/callback. You do not need Authorized JavaScript origins.

To change it later, open Clients, click the client, edit the URI and click Save. Google can take a few minutes to apply the change.

Turn it on in Auto Tournament

In Settings → Sign-in → Google, paste the Client ID and Client Secret, turn it on and save. The callback URL to register is shown there with a copy button. The Sign in with Google button appears on the login page right away.

Prefer environment variables? Set AUTH_GOOGLE_ENABLED=true, GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET and restart. They are imported once.

Test the button

  1. Open FRONTEND_BASE_URL/login in a private browser window.
  2. Click Sign in with Google and pick your Google account.
  3. You are signed in. Someone new gets an account of their own when registration is open (Settings → Players & Access). Steam can be linked later on /me/connections.

While the app is in Testing, only the test users you add under Audience can sign in. To let anyone with a Google account sign in, open Audience and click Publish app. The scopes Auto Tournament asks for do not need Google's app verification.

If Google shows "Error 400: redirect_uri_mismatch", the redirect URI in step 2 does not match FRONTEND_BASE_URL exactly.

On this page