Files
coder/docs/admin/users/github-auth.md
T
Nick Vigilante 16551fd67f feat: enable Coder.AbbreviationFirstUse (#30878)
Adds `Coder.AbbreviationFirstUse`, a Vale rule that requires each
abbreviation to be expanded on its first use on a page, in the form
"Expanded Form (ABBR)". It supports [WCAG 2.2 Level AAA Success
Criterion 3.1.4
(Abbreviations)](https://www.w3.org/TR/WCAG22/#abbreviations). Following
the "Adding a Vale rule" pattern in `docs/.style/README.md`, the PR has
two commits: the cleanup first, then the enable.

## Cleanup commit

431 first uses expanded across 167 pages, so the rule ships with zero
findings across `docs/`, excluding `docs/.style/style-guide/`. The
branch was rebuilt on current `main`, so pages added or moved since the
first draft are covered.

- Where the first use is a bold UI label (**CA Path**, **Add redirect
URI**, **Redirect URI**), the label stays as the UI shows it and the
expansion goes elsewhere in the same paragraph or list item.
- Reversed forms such as "PKCE (Proof Key for Code Exchange)" are
flipped to the expanded-first form.
- A few sentences took a small rewording to fit the expansion: list
steps that would pass the 20-word limit (`Coder.StepLength`), and spots
where the expansion would nest parentheses.
- MITM is expanded as "machine-in-the-middle" rather than
"man-in-the-middle". Every use describes the AI Gateway Proxy
intercepting traffic on purpose, so "on-path attacker" doesn't fit. The
inclusive-language table on `accessibility-and-inclusion.md` gains the
substitution: "on-path attacker" for the attack, "machine-in-the-middle"
for the feature.
- Unrelated fixes on lines already being edited: `DERP MAP` → `DERP
map`, and `ENV` → "environment variable" in `faqs.md`.

## Enable commit

**Rule design.** The rule is a `conditional`. `first` matches 2 to 6
capitals, each optionally followed by digits (`EC2`, `P2P`), and a
lookahead lets a plural `s` count as a use of the singular. `second`
captures the abbreviation in `word (ABBR)`, including `(CI/CD)` and
`(PCI DSS)` pairs. Vale collects the captures across the page's blocks
in document order, so a later expansion doesn't cover an earlier use.
Within a single paragraph, list item, or table cell, an expansion
anywhere in the block counts.

**Scope.** `scope: ~heading` skips headings, because a page title often
names an abbreviation that the first paragraph then expands. Vale
already skips front matter, code blocks, inline code, and link URLs.
`.vale.ini` turns the rule off for the pages generated from Go source
that `Coder.UnitSpacing` already skips: `docs/reference/{api,cli}/*.md`,
`configuration-reference.md`, and `prometheus.md`.

**Severity: `warning`.** Whether an abbreviation is familiar enough to
skip is a judgment call, so this is guidance with legitimate exceptions,
not hard policy.

**Exceptions**, each group commented in the rule file:

| Group | Entries | Reason |
| --- | --- | --- |
| Known to every reader | AI, API, AWS, CLI, CPU, DNS, GCP, HTTP(S), ID,
IDE, IP, JSON, OS, PR, RAM, SDK, SQL, SSH, TLS, UI, URL, VM, YAML |
Abbreviations every reader of the docs knows. Plurals such as VMs and
SDKs pass too |
| Units, clock times, file and package formats | GB, KB, MB, AM, PM,
CSV, GIF, JPEG, PDF, PNG, RPM, SVG, VSIX, ZIP | Readers know these by
the abbreviation, not the expansion |
| Not abbreviations | NOTE, TIP, OK, README, SKILL, ALL, AND, ANY,
ERROR, MUST, NOT, ON, OR, DELETE, GET, POST, PUT, ILIKE, VACUUM, LOGIN,
PLAIN, NUL, CRON, TERM, DOCS, `DOC\d+`, `RFC\d+`, TL, DR | Alert labels,
file names, emphasis in capitals, HTTP methods, SQL keywords, SMTP auth
mechanisms, rule labels in `docs/AGENTS.md`, RFC numbers, TL;DR |
| Names written in capitals | VS, IDEA, IU, NGINX, SUSE, GNU, XFCE, DX,
IBM, DCV, TRAMP, MSYS2, NET, VSX, ARM, AMD, GPT, AES, GCM, HMAC, HS256,
RSA, SHA, SHA256 | The capitals are the product, company, or algorithm
name (VS Code, IntelliJ IDEA, .NET, Open VSX, Amazon DCV, AMD) |

The "known to every reader" group is the list that needs judgment, and
it's the one to push back on. The other groups only stop the regex from
treating words and names as abbreviations.

**Documentation.** A new "Expand abbreviations on first use" section on
`accessibility-and-inclusion.md`, and the style guide README's checks
table, coverage table, and rule counts (90 → 91 rules, 22 → 23
tool-checked).

## Known limits

- The rule checks that an expansion exists, not that it's correct: any
word followed by `(ABBR)` satisfies it.
- An abbreviation in an image's alt text is checked before the paragraph
around it, so one alt text (`aws-marketplace.md`) carries its own
expansion.
- Some expansions read heavily in dense table cells and inline lists,
for example the four Kubernetes services in `docker-in-workspaces.md`.
They're correct, but a reviewer may prefer adding a specific
abbreviation to the exceptions instead.

## Testing

- `vale docs/` (Vale 3.7.1 through mise): zero
`Coder.AbbreviationFirstUse` findings. Findings from every other rule
match `main` file for file.
- `pnpm run format-docs`, `pnpm run lint-docs`,
`scripts/check_emdash.sh`, and `make lint/prose` run clean, and the
repository pre-commit hooks (including `lint/style-claims`) pass on both
commits.

Linear: DOCS-1311

Generated by Coder Agents on behalf of @nickvigilante.
2026-11-02 14:41:15 -05:00

6.3 KiB

title
title
GitHub

By default, new Coder deployments use a Coder-managed GitHub app to authenticate users. We provide it for convenience, allowing you to experiment with Coder without setting up your own GitHub OAuth app.

If you authenticate with it, you grant the control plane read access to your GitHub user email and other metadata listed during the authentication flow.

This access is necessary for the control plane to complete the authentication process. To the best of our knowledge, Coder, the company, does not gain access to this data by administering the GitHub app.

Default Configuration

Important

Installation of the default GitHub app grants Coder (the company) access to your organization's GitHub data.

For production environments, we strongly recommend that you configure your own GitHub OAuth app to ensure that your data is not shared with Coder (the company).

To use the default configuration:

  1. Install the GitHub app in any GitHub organization that you want to use with Coder.

    The default GitHub app requires device flow to authenticate. This is enabled by default when using the default GitHub app. If you disable device flow using CODER_OAUTH2_GITHUB_DEVICE_FLOW=false, it will be ignored.

  2. By default, only the admin user can sign up. To allow additional users to sign up with GitHub, add:

    CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
    
  3. (Optional) If you want to limit sign-ups to specific GitHub organizations, set:

    CODER_OAUTH2_GITHUB_ALLOWED_ORGS="your-org"
    

Disable the Default GitHub App

You can disable the default GitHub app by configuring your own app or by adding the following environment variable to your control plane configuration:

CODER_OAUTH2_GITHUB_DEFAULT_PROVIDER_ENABLE=false

Note

After you disable the default GitHub provider, the Sign in with GitHub button might still appear on your login page even though the authentication flow is disabled.

To completely hide the GitHub sign-in button, you must disable the default provider and ensure you don't have a custom GitHub OAuth app configured.

Step 1: Configure the OAuth application in GitHub

  1. Register a GitHub OAuth app.

  2. GitHub will ask you for the following Coder parameters:

    • Homepage URL: Set to your Coder deployment's CODER_ACCESS_URL (for example, https://coder.domain.com)

    • User Authorization Callback URL: Set to https://coder.domain.com

      If you want to allow multiple Coder deployments hosted on subdomains, such as coder1.domain.com, coder2.domain.com, to authenticate with the same GitHub OAuth app, then you can set User Authorization Callback URL to the https://domain.com

  3. Take note of the Client ID and Client Secret generated by GitHub.

    You will use these values in the next step.

  4. Coder needs permission to access user email addresses.

    Find the Account Permissions settings for your app and select read-only for Email addresses.

Step 2: Configure Coder with the OAuth credentials

The control plane reads these settings from environment variables. Set them wherever your deployment manages environment variables. For example, use Helm values.yaml for Kubernetes or /etc/coder.d/coder.env for a system service.

Kubernetes (Helm): set the variables under coder.env in your values.yaml:

coder:
  env:
    - name: CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS
      value: "true"
    - name: CODER_OAUTH2_GITHUB_CLIENT_ID
      value: "533...des"
    - name: CODER_OAUTH2_GITHUB_CLIENT_SECRET
      value: "G0CSP...7qSM"
    # If setting allowed orgs, comment out CODER_OAUTH2_GITHUB_ALLOW_EVERYONE and its value
    - name: CODER_OAUTH2_GITHUB_ALLOWED_ORGS
      value: "your-org"
    # If allowing everyone, comment out CODER_OAUTH2_GITHUB_ALLOWED_ORGS and its value
    #- name: CODER_OAUTH2_GITHUB_ALLOW_EVERYONE
    #  value: "true"

Then apply the change with helm upgrade:

helm upgrade <release-name> coder-v2/coder -n <namespace> -f values.yaml

System service: add the variables to /etc/coder.d/coder.env:

CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
CODER_OAUTH2_GITHUB_ALLOWED_ORGS="your-org"
CODER_OAUTH2_GITHUB_CLIENT_ID="8d1...e05"
CODER_OAUTH2_GITHUB_CLIENT_SECRET="57ebc9...02c24c"

Then restart Coder with sudo service coder restart.

Tip

To allow everyone to sign up using GitHub, set:

CODER_OAUTH2_GITHUB_ALLOW_EVERYONE=true

For GitHub Enterprise support, also set CODER_OAUTH2_GITHUB_ENTERPRISE_BASE_URL.

Note

Every option above also has an equivalent CLI flag (for example, CODER_OAUTH2_GITHUB_CLIENT_ID becomes --oauth2-github-client-id). CLI flags are convenient for ad-hoc invocations of coder server during local development. For production deployments, prefer environment variables so the configuration lives with the container, Helm chart, or service unit that manages Coder. See the configuration reference for the full mapping between environment variables and flags.

We recommend requiring and auditing multi-factor authentication (MFA) usage for all users in your GitHub organizations. This can be enforced from the organization settings page in the Authentication security sidebar tab.

Device Flow

Coder supports device flow for GitHub OAuth. This is enabled by default for the default GitHub app and cannot be disabled for that app.

For your own custom GitHub OAuth app, you can enable device flow by setting:

CODER_OAUTH2_GITHUB_DEVICE_FLOW=true

Device flow is optional for custom GitHub OAuth apps. We generally recommend using the standard OAuth flow instead, as it is more convenient for end users.

Note

If you're using the default GitHub app, device flow is always enabled regardless of the CODER_OAUTH2_GITHUB_DEVICE_FLOW setting.