Google sign-in
Google sign-in is an alternative to email and password. It is entirely optional:
unset, the button is hidden and POST /auth/google returns 503.
-
Create OAuth client ids in the Google Cloud console — a Web client for the admin panel, and an Android client (package name plus signing certificate fingerprint) if you use the app.
-
Tell the server which client ids to accept:
.env GOOGLE_OAUTH_CLIENT_IDS=<web-client-id>,<android-client-id>These are the only audiences the server will accept on an incoming ID token.
-
Tell the clients which client id to use — the panel and the app each read the web client id from their own build configuration.
-
Restart the API and confirm
googleOAuthistrueinGET /config/status.
How verification works
Section titled “How verification works”The client obtains a Google ID token and posts it to /auth/google. The
server then:
- fetches Google’s public signing keys,
- verifies the token’s signature,
- checks the issuer, the expiry, and that the audience is one of your configured client ids,
- finds or creates the matching account, and returns a normal Watcher token.
Verification is done locally against Google’s published keys; there is no OAuth SDK and no callback URL to configure on the server.
Accounts
Section titled “Accounts”- A first Google sign-in creates an account with the
userrole, and its email is treated as verified. - Signing in with Google to an address that already has a password account links them, so either method works afterwards.
- A Google-only account has no password until it sets one through the reset flow.
Turning it off
Section titled “Turning it off”Remove GOOGLE_OAUTH_CLIENT_IDS and restart. Existing accounts keep working
through email and password, provided they have one.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause |
|---|---|
| The button does not appear | The client has no client id configured, or the server has none |
503 from /auth/google |
GOOGLE_OAUTH_CLIENT_IDS is unset on the server |
401 with a valid-looking token |
The token’s audience is not in the server’s list — usually the Android client id is missing |
| Works on web, fails on Android | The Android OAuth client needs the app’s package name and signing fingerprint registered |