Support OAuth client_secret_basic#1448
Open
MisterJimson wants to merge 3 commits into
Open
Conversation
MisterJimson
marked this pull request as ready for review
July 21, 2026 20:23
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.
Summary
Add configurable OAuth token-endpoint client authentication so registered clients can use either
client_secret_postorclient_secret_basic. The selected method is persisted and reused across authorization-code exchange, client-credentials minting, refresh, and re-minting.client_secret_basicuses the interoperable HTTP Basic representation expected by common providers: Base64 of the literal UTF-8client_id:client_secretpair.Closes #1447
Changes
client_secret_postandclient_secret_basicthrough the OAuth client API and registration form.client_secret_postas the default for existing clients.client_secret_basicas the literal credential pair instead of form-encoding each component before Base64 encoding.Interoperability example: Aikido
Aikido's OAuth documentation requires client credentials in an HTTP Basic authorization header for its token endpoint.
The strict RFC 6749 representation form-encodes each credential component before Base64 encoding. For example, an Aikido client ID beginning with
AIK_CLIENT_is transmitted asAIK%5FCLIENT%5F.... Aikido compares the decoded Basic username and password literally, so it rejects that representation as invalid credentials even though the same pair succeeds with conventional Basic clients such ascurl --user.Using Base64 of the literal credential pair makes this real provider work while retaining the expected
client_secret_basicrequest shape. See RFC 6749 §2.3.1 for the strict encoding rule and the note that HTTP Basic is not otherwise recommended outside this client-authentication profile.Testing
bun run format:checkbun run lintNotes for reviewers
The Basic encoding is intentionally interoperable rather than RFC-strict. Exposing separate “strict” and “raw” Basic choices would require users to understand a wire-level distinction that OAuth provider documentation generally does not surface. If a provider requiring strict component encoding is identified, that can be added later as an advanced compatibility mode with a concrete test case.