8000 Add support for looking up client secrets via Vault SPI by tsaarni · Pull Request #39650 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for looking up client secrets via Vault SPI #39650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our term 8000 s of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsaarni
Copy link
Contributor
@tsaarni tsaarni commented May 12, 2025

This PR adds support for resolving client secrets via the Vault SPI, enabling retrieval from secure storage instead of storing them in plaintext in the database. While the Vault SPI has some usability limitations, this approach is less invasive than alternatives like hashing or introducing new encrypt/decrypt SPI. It also preserves the plaintext access to the secret, which is required by existing use cases.

Notes:

(1) At the moment, the admin console only supports generating new random client secrets. There is no way for administrators to specify a vault reference value. However, the Admin REST API does support setting the client secret explicitly, including reference valu 8000 es. To fully support this feature, the admin console will need to be extended to allow entering reference values as well. Note: If a new random client secret is generated via the admin console, it will overwrite the existing reference.

(2) The client secret rotation feature introduces additional complexity. Triggering rotation will overwrite any reference-based secret with a newly generated random secret.

(3) Since the client secret may be accessed frequently, using a remote Vault SPI implementation with network communication can introduce latency. To avoid repeated lookups, Vault SPI implementation may choose to add caching.

TODO

  • Add test cases for the new Vault-based client secret resolution.
  • Extend the admin console to support setting client secret references.
  • Add documentation.

Fixes #13102

If vault SPI is defined, lookup client secret (and rotated client secret) from
vault implementation.

Signed-off-by: Tero Saarni <tero.saarni@est.tech>
@tsaarni tsaarni force-pushed the vault-client-secret branch from e70f337 to 2cdc36d Compare May 12, 2025 18:24
@tsaarni
Copy link
Contributor Author
tsaarni commented May 12, 2025

Hi @mhajas, I noticed that you had opened an issue requesting this feature a few years ago. I’m interested in contributing it and would be glad to continue working on it. Before proceeding, I wanted to check if this is still a feature you'd consider including in Keycloak?

@mhajas
Copy link
Contributor
mhajas commented May 13, 2025

Thank you for the PR @tsaarni. I would say it still makes sense to include this since it is highly upvoted issue. I would be happy to help or find someone else who would be willing to help.

I will have a look at the changes later this week. Let me know if you need something else at this stage.

@mhajas mhajas self-assigned this May 13, 2025
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.

Add support for specifying client.secret using vault
2 participants
0