Files
coder/docs/admin/users/oidc-auth/google.md
T
coder[bot] 155861f04e docs: replace ensure, should, and since per the Vale spike review (#31879)
Applies the Vale findings spike review's `ensure`, `should`, and `since`
decisions, following
`word-choice.md#choose-words-that-have-one-meaning`.

## `ensure`, `ensures`, `ensuring`: every row marked valid

- 148 lines in 70 files.
- Most became `make sure`, `makes sure`, or `making sure`.
- When the subject isn't a person, I used a verb that reads better, such
as `guarantees`, `keeps`, `prevents`, `maintains`, or `provides`.
- `admin/monitoring/health-check.md:227`: "Make sure that" is now "Make
sure", so the step stays within `Coder.StepLength`.
- Left as-is: `admin/setup/configuration-reference.md:1339`, which is
generated from `codersdk`.

## `should` and `since`: only rows with a verdict or a note

- `.style/README.md`: "what should be routed elsewhere" is now "what to
route elsewhere".
- `.style/content-guidelines.md`:
  - "Avoid mixing those modes within a single page."
  - "Every page must be accurate"
  - "Check docs claims against the actual implementation"
  - "must include the documentation"
  - "Support owns the content they produce."
  - "because they don't change"
- `.style/styles/Coder/README.md`: "must link to the matching section".
- `admin/external-auth.md`:
  - "The redirect URI for Gitea is ..."
- "Use custom authentication and token URLs ...", which is now active
voice.
- `envbuilder-releases-known-issues.md`: "so it's experimental and prone
to breaking changes".

Rows marked unsure with no note were left alone: `content-guidelines.md`
lines 49, 330, and 405, and `envbuilder/index.md:24`.

The changed files have no new findings from other rules.

---
AI-generated by Superblink on behalf of @nickvigilante.

---------

Co-authored-by: coder[bot] <137810501+coder[bot]@users.noreply.github.com>
2026-11-06 22:26:01 +00:00

2.2 KiB

title
title
Google authentication (OIDC)

This guide shows how to configure Coder to authenticate users with Google using OpenID Connect (OIDC).

Prerequisites

  • A Google Cloud project with the OAuth consent screen configured
  • Permission to create OAuth 2.0 Client IDs in Google Cloud

Step 1: Create an OAuth client in Google Cloud

  1. Open Google Cloud Console → APIs & Services → Credentials → Create Credentials → OAuth client ID.
  2. Application type: Web application.
  3. Authorized redirect Uniform Resource Identifiers (URIs): add your Coder callback URL:
    • https://coder.example.com/api/v2/users/oidc/callback
  4. Save and note the Client ID and Client secret.

Step 2: Configure Coder OIDC for Google

Set the following environment variables on your Coder deployment and restart Coder:

CODER_OIDC_ISSUER_URL=https://accounts.google.com
CODER_OIDC_CLIENT_ID=<client id>
CODER_OIDC_CLIENT_SECRET=<client secret>
# Restrict to one or more email domains (comma-separated)
CODER_OIDC_EMAIL_DOMAIN="example.com"
# Standard OIDC scopes for Google
CODER_OIDC_SCOPES=openid,profile,email
# Optional: customize the login button
CODER_OIDC_SIGN_IN_TEXT="Sign in with Google"
CODER_OIDC_ICON_URL=/icon/google.svg

Note

The redirect URI must exactly match what you configured in Google Cloud.

Google uses auth URL parameters to issue refresh tokens. Configure:

# Keep standard scopes
CODER_OIDC_SCOPES=openid,profile,email
# Add Google-specific auth URL params
CODER_OIDC_AUTH_URL_PARAMS='{"access_type": "offline", "prompt": "consent"}'

After changing settings, users must log out and back in once to obtain refresh tokens.

Learn more in Configure OIDC refresh tokens.

Troubleshooting

  • "invalid redirect_uri": make sure the redirect URI in Google Cloud matches https://<your-coder-host>/api/v2/users/oidc/callback.
  • Domain restriction: if users from unexpected domains can log in, verify CODER_OIDC_EMAIL_DOMAIN.
  • Claims: to inspect claims returned by Google, see guidance in the OIDC overview.

See also