Add client_secret_expires_at to Dynamic Client Registration response#311
Open
55728 wants to merge 1 commit into
Open
Add client_secret_expires_at to Dynamic Client Registration response#31155728 wants to merge 1 commit into
client_secret_expires_at to Dynamic Client Registration response#31155728 wants to merge 1 commit into
Conversation
RFC 7591 §3.2.1 and OIDC Dynamic Client Registration 1.0 §3.2 require client_secret_expires_at whenever a client_secret is issued. Doorkeeper secrets never expire, so emit 0 (no expiration) for confidential clients.
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
When the Dynamic Client Registration endpoint issues a
client_secret(i.e. for confidential clients), the registration response is missing the REQUIREDclient_secret_expires_atmember.client_secret_expires_atis REQUIRED ifclient_secretis issued.0is the spec-defined sentinel meaning "the secret does not expire".Doorkeeper-issued client secrets never expire, so this PR emits
client_secret_expires_at: 0whenever aclient_secretis present in the response. Public clients (token_endpoint_auth_method: none) receive neitherclient_secretnorclient_secret_expires_at, which is also correct per spec.Changes
dynamic_client_registration_controller.rb— addclient_secret_expires_at: 0to the response inside theconfidential_client?branch.dynamic_client_registration_controller_spec.rbclient_secret_expires_at == 0forclient_secret_basicandclient_secret_postnone) clientSpec conformance
client_secret_expires_atREQUIRED if aclient_secretis issued;0= never expiresBackward compatibility
Additive only — a new member appears in the registration response for confidential clients. No existing field changes value or shape. Clients that ignore unknown members are unaffected; spec-compliant clients that validated the response against the RFC now see a conformant body.
Testing