Skip to content

feat: reject secret creation and fix reporting for public clients - #28097

Draft
BobbyHo wants to merge 1 commit into
oauth2-public-clients-token-exchangefrom
oauth2-public-clients-guards
Draft

feat: reject secret creation and fix reporting for public clients#28097
BobbyHo wants to merge 1 commit into
oauth2-public-clients-token-exchangefrom
oauth2-public-clients-guards

Conversation

@BobbyHo

@BobbyHo BobbyHo commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Split out of #27873 to make that PR smaller to review. Fifth in the stack (on top of #28047). Closes two remaining gaps beyond registration and the token endpoint: the admin secrets API, and what auth method gets reported back for a legacy-mismatched client.

  • CreateAppSecret rejects minting a secret for a public client (RFC 7591 §2) — deleting a secret the token endpoint never validated would look like a kill switch while revoking nothing, since a public client's tokens carry no app_secret_id
  • reportedAuthMethod() normalizes what token_endpoint_auth_method registration, GET, and PUT report back when a client's stored method and client_type disagree, so Coder never tells a client to authenticate in a way the token endpoint won't accept

Refs https://linear.app/codercom/issue/ENG-3029/oauth2-support-public-client

Fourth in the stack splitting up #27873 (public OAuth2 clients), on top
of #28047. Closes two remaining gaps beyond registration and the token
endpoint: the admin/API surface for managing client secrets, and what
auth method Coder reports back to a client whose stored method and
client_type disagree.

CreateAppSecret now rejects minting a secret for a public client
(RFC 7591 §2, OAuth 2.1 §2.1: a public client authenticates with PKCE
alone). Without this, an operator could create a secret the token
endpoint never validates, and deleting it would look like a kill
switch while revoking nothing, since a public client's tokens carry a
NULL app_secret_id.

reportedAuthMethod() normalizes what token_endpoint_auth_method
CreateDynamicClientRegistration, GetClientConfiguration, and
UpdateClientConfiguration report back for a client whose stored method
and client_type disagree. This only arises for clients registered
before client_type was derived from the method: such a row is stored
confidential with a method of "none", and reporting "none" verbatim
would tell the client to drop a secret its exchange still requires.
Reporting the enforced behavior instead means the client's next PUT
repairs the mismatch on its own.
@github-actions

Copy link
Copy Markdown

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant