Skip to content

Admin API V2: allow to generate secret for clients with authentication method 'client-secret'#46257

Open
michalvavrik wants to merge 1 commit intokeycloak:mainfrom
michalvavrik:feature/issue-46136-gen-cl-sec
Open

Admin API V2: allow to generate secret for clients with authentication method 'client-secret'#46257
michalvavrik wants to merge 1 commit intokeycloak:mainfrom
michalvavrik:feature/issue-46136-gen-cl-sec

Conversation

@michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Feb 12, 2026

New behavior follows how I understand what is described in the linked issue. That is:

  • adds endpoint that supports generation of secret for authentication method 'client-secret'
  • if confidential client is created with method 'client-secret' without secret, we generate it and return it
  • if confidential client is updated (PUT) with method 'client-secret' without secret, we generate it
  • if confidential client is patched with method 'client-secret' without secret, we generate it
  • if confidential client with 'client-secret' auth method is patched without auth config, we keep the previous (existing) authentication configuration including the secret
  • if confidential client with 'client-secret' auth method is updated without auth config, we turn the client into public client
  • if confidential client with 'client-secret' auth method is updated or patched with auth object that has method 'client-secret' but no secret, we only generate the secret if it wasn't previously present on the client model

Copy link
Contributor

@mabartos mabartos left a comment

Choose a reason for hiding this comment

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

@michalvavrik Just a brief syntactic review for now.

@michalvavrik
Copy link
Member Author

Re CI failures: LoggingDistTest.httpAccessLogMaskedCookiesDiffFormat is passing for me locally, I'll just not investigate for now. Maybe it is flaky and it will be fixed when pushing changes.

@michalvavrik michalvavrik force-pushed the feature/issue-46136-gen-cl-sec branch 2 times, most recently from 76a97dd to 07e5b9a Compare February 12, 2026 11:50
New behavior follows what is described in the linked issue. That is:

- adds endpoint that supports generation of secret for authentication method 'client-secret'
- if confidential client is created with method 'client-secret' without secret, we generate it and return it
- if confidential client is updated (PUT) with method 'client-secret' without secret, we generate it
- if confidential client is patched with method 'client-secret' without secret, we generate it
- if confidential client with 'client-secret' auth method is patched without auth config, we keep the previous (existing) authentication configuration including the secret
- if confidential client with 'client-secret' auth method is updated or patched with auth object that has method 'client-secret', we only generate the secret if it wasn't previously present on the client model

Closes: keycloak#46136

Signed-off-by: Michal Vavřík <michal.vavrik@aol.com>
@michalvavrik michalvavrik force-pushed the feature/issue-46136-gen-cl-sec branch from 07e5b9a to 6ce6e51 Compare February 12, 2026 11:53
@vmuzikar
Copy link
Contributor

Putting on hold until the discussion in the parent issue is resolved.

@vmuzikar vmuzikar added the status/hold PR should not be merged. On hold for later. label Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/hold PR should not be merged. On hold for later. team/cloud-native

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for generating client secret in Client v2

3 participants