feat: register public clients without a secret - #28046
Draft
BobbyHo wants to merge 1 commit into
Draft
Conversation
Docs previewCheck 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. |
Split out of #27873 to make that PR smaller to review. Third in the stack; this is the point where dynamic client registration actually produces a public client. An RFC 7591 registration requesting token_endpoint_auth_method: "none" now skips secret generation entirely: no secret is minted, and the app is persisted with the client_type the previous PR in the stack derives from that auth method. Discovery advertises "none" as a supported method so a client can find out Coder will accept it. Registration now writes the app and its secret in one transaction. They were two independently committed inserts, so a failure of the second left a permanently committed app that can never authenticate while still holding a registration access token. Pre-existing, but making a public client's "no secret row" a legitimate state removes the ability to spot the orphaned confidential case by inspection later, so it is fixed here alongside the rest of this change. The registration_client_uri now uses url.JoinPath instead of fmt.Sprintf, fixing a latent bug where an access URL configured with a trailing slash would mint "//oauth2/clients/{id}" as the client's management endpoint. The token endpoint does not yet accept a public client's PKCE-only exchange; that follows in the next PR in the stack, so a client registered here cannot yet obtain a token.
BobbyHo
force-pushed
the
oauth2-public-clients-vocabulary
branch
from
August 12, 2026 00:18
0d8a377 to
01ec6b3
Compare
BobbyHo
force-pushed
the
oauth2-public-clients-registration
branch
from
August 12, 2026 00:18
872b5e3 to
7c8d3e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #27873 to make that PR smaller to review. Third in the stack (on top of #28043); this is the point where dynamic client registration actually produces a public client.
An RFC 7591 registration requesting
token_endpoint_auth_method: "none"now skips secret generation entirely: no secret is minted, and the app is persisted with theclient_typethe previous PR in the stack derives from that auth method. Discovery advertises"none"as a supported method so a client can find out Coder will accept it.Registration now writes the app and its secret in one transaction. They were two independently committed inserts, so a failure of the second left a permanently committed app that can never authenticate while still holding a registration access token. Pre-existing, but making a public client's "no secret row" a legitimate state removes the ability to spot the orphaned confidential case by inspection later, so it's fixed here alongside the rest of this change.
registration_client_urinow usesurl.JoinPathinstead offmt.Sprintf, fixing a latent bug where an access URL configured with a trailing slash would mint//oauth2/clients/{id}as the client's management endpoint.The token endpoint does not yet accept a public client's PKCE-only exchange; that follows in the next PR in the stack, so a client registered here cannot yet obtain a token. Dynamic client registration itself is off by default (
GetOAuth2DCREnabled), so this is not user-visible until the next PR lands.Refs https://linear.app/codercom/issue/ENG-3029/oauth2-support-public-client