Skip to content

Derive token_endpoint_auth_methods_supported from Doorkeeper's client_credentials config#236

Merged
nbulaj merged 2 commits into
masterfrom
copilot/disable-client-secret-basic-option
Mar 15, 2026
Merged

Derive token_endpoint_auth_methods_supported from Doorkeeper's client_credentials config#236
nbulaj merged 2 commits into
masterfrom
copilot/disable-client-secret-basic-option

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

token_endpoint_auth_methods_supported in the OIDC discovery response was hardcoded to [client_secret_basic, client_secret_post], ignoring Doorkeeper's client_credentials configuration which already controls which methods are accepted.

Changes

  • discovery_controller.rb: Replace hardcoded array with a dynamic mapping from Doorkeeper's client_credentials_methods (:from_basicclient_secret_basic, :from_paramsclient_secret_post)
  • discovery_controller_spec.rb: Add coverage for from_basic-only, from_params-only, and both-configured cases

Example

# doorkeeper.rb initializer
Doorkeeper.configure do
  client_credentials :from_basic  # only HTTP Basic Auth
end

# Discovery endpoint now correctly reflects:
# "token_endpoint_auth_methods_supported": ["client_secret_basic"]

Default Doorkeeper config ([:from_basic, :from_params]) preserves the existing behaviour.

Original prompt

This section details on the original issue you should resolve

<issue_title>Possible to disable client_secret_basic for token_endpoint_auth_methods_supported?</issue_title>
<issue_description>Hi, thanks for developing this library. It's super useful in setting up an OIDC server as part of a platform.

Is it possible to disable client_secret_basic as an option for token_endpoint_auth_methods_supported? I see that it's hardcoded in the controller:

token_endpoint_auth_methods_supported: %w[client_secret_basic client_secret_post],
– has there been some consideration in making this configurable?

I'm happy to submit a PR to support this.</issue_description>

<agent_instructions>Can you review the comments and say WDYT? No need to open any PRs, just analyze comments and say which changes we have to introduce</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@nbulaj Hello @jits . I believe it depends on doorkeeper main config where we define `client_credentials` option which can be `:from_basic, :from_params` . So only if config option set to `:from_basic` then `client_secret_post` should be removed from the list. I think it shouldn't be configurable for doorkeeper-openid_connect, but has to retrieve configured option from the Doorkeeper config instead.

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add option to disable client_secret_basic authentication Derive token_endpoint_auth_methods_supported from Doorkeeper's client_credentials config Mar 14, 2026
Copilot AI requested a review from nbulaj March 14, 2026 08:52
…redentials config

Co-authored-by: nbulaj <1443426+nbulaj@users.noreply.github.com>
@nbulaj nbulaj force-pushed the copilot/disable-client-secret-basic-option branch from 1ecb78d to 8f9e6a9 Compare March 15, 2026 07:41
@nbulaj nbulaj marked this pull request as ready for review March 15, 2026 07:41

@nbulaj nbulaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nbulaj nbulaj merged commit 3111492 into master Mar 15, 2026
44 checks passed
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.

Possible to disable client_secret_basic for token_endpoint_auth_methods_supported?

2 participants