Files
coder/docs/admin/integrations/oauth2-provider/security.md
coder[bot] d91aa1bebd docs: replace may with can or might per the Vale spike review (#31878)
Replaces `may` with `can` (ability or permission) or `might`
(possibility), following
`word-choice.md#choose-words-that-have-one-meaning`. The Vale findings
spike review marked every `may` row valid.

- 247 lines in 110 files: 75 became `can` and 162 became `might`. The
rest are small rewordings, such as "may wish" becoming "might want".
- Applied the reviewer notes:
- `.style/content-guidelines.md`: "docs may be written ahead" is now
"you can write docs ahead", which also drops the passive voice.
- `admin/external-auth.md`: now "You can grant access to a subset of
repositories.", so the sentence doesn't end on a preposition.
- Also fixed a typo in `gcp-to-aws.md`: "may needed" is now "might
need".

## Left as-is

- **`admin/setup/configuration-reference.md` (7 lines):** this page is
generated from `codersdk` deployment options (`<!-- DO NOT EDIT |
GENERATED CONTENT -->`), so the fix belongs in the Go option
descriptions, followed by `make gen`.
- **Text that quotes the product:**
- `admin/monitoring/health-check.md:196` matches the derphealth message.
- The heading at `templates/troubleshooting.md:45`, the first "may" on
line 47, and the link on line 67 match the web terminal's "your
workspace may be incomplete" warning and its anchor.
- `admin/integrations/oauth2-provider/troubleshooting.md:269` quotes a
server error.

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 17:17:35 -05:00

4.1 KiB

title
title
OAuth2 provider security and limitations

This page covers security guidance and current limitations.

Security considerations

  • Use HTTPS: Always use HTTPS in production to protect tokens in transit
  • Implement PKCE: Proof Key for Code Exchange (PKCE) is mandatory for all authorization code clients (public and confidential)
  • Validate redirect URLs: Only register trusted redirect URIs. Dangerous schemes (javascript:, data:, file:, ftp:) are blocked by the control plane, custom Uniform Resource Identifier (URI) schemes for native apps (myapp://) are permitted, and public clients additionally cannot use mailto:, tel:, or sms:
  • Rotate secrets: Periodically rotate client secrets using the management API
  • Rate limits: every /oauth2 endpoint and both /.well-known discovery endpoints draw on the login rate limit of 60 requests per minute. Each endpoint counts on its own, so a caller that exhausts one can still reach the others. Requests with no Coder session are counted per IP address, and the rest are counted per user. A caller over the limit receives HTTP 429 with a temporarily_unavailable error body. The limit is fixed. Running the deployment with --dangerous-disable-rate-limits turns it off, and a user with the Owner role can bypass it on a single request with the X-Coder-Bypass-Ratelimit header
  • Refresh tokens are not self-sufficient: a confidential client must present its client_secret to refresh or revoke, so a leaked token alone cannot mint new access tokens or end another client's session
  • No CORS on the authorization endpoint: /oauth2/authorize is reached only by browser navigation and sends no cross-origin resource sharing (CORS) headers, as OAuth 2.1 requires. The token, registration, revocation, and metadata endpoints do allow cross-origin requests so that browser-based clients can call them

Limitations

The current implementation has these limitations:

  • No client credentials grant support
  • No support for the device authorization grant, which Request for Comments (RFC) 8628 defines
  • Implicit grant (response_type=token) is not supported. OAuth 2.1 deprecated this flow due to token leakage risks, and a request for it redirects to the registered callback with unsupported_response_type
  • Limited to opaque access tokens (no support for JSON Web Tokens (JWTs))
  • An application can register at most 32 redirect URIs of at most 2048 bytes each. An application that stored a longer list before this limit existed keeps working, but it cannot be saved again until the list fits. To fix it, send a PUT with a redirect_uris list that fits, as shown under Create an application with the API. In the web UI, open the application and remove entries from Redirect URIs until the list fits.
  • A cleartext http:// redirect URI to a host that is not local is rejected. Earlier versions accepted one through the management API for a confidential application, although Dynamic Client Registration always refused it. An application that stored one keeps working, but it cannot be saved again until its list uses https:// or a local host, as described under Callback URL schemes.
  • A redirect URI with a private-use scheme must name a path or an authority, as described under Callback URL schemes. Dynamic Client Registration accepted the bare form, such as com.example.app:callback, in earlier versions. A client that registered one can re-register with an accepted form, or an administrator can correct it with the same PUT.

Learn more