Replies: 9 comments 16 replies
-
Proposal: Provide explicit management for two or multiple secrets which are all valid if set. No need for primary and secondary semantics. An optional description ids helpful, to mark the secret as "current" or as "new one". |
Beta Was this translation helpful? Give feedback.
-
It would also be beneficial if Keycloak could emit some sort of warning when a 'deprecated' or 'secondary' key is used. That will make it easier to notice if a client hasn't been updated to use the new secret. |
Beta Was this translation helpful? Give feedback.
-
8000
-
The way Azure AD does it is by allowing arbitrary numbers of secrets, each having an ID, a description and an expiration date. Pretty flexible, even allowing to give different secrets to different people with different expirations. But classic rotation has to be done by hand. Maybe that's a good compromise? |
Beta Was this translation helpful? Give feedback.
-
Starting to wonder if we can do something smarter here; we can add new secret, and remove the old when the new one has been used. Or, if new isn't used within X minutes rollbacks to the old one and add an error event. |
Beta Was this translation helpful? Give feedback.
-
Few questions:
I suppose that if we want to support it, the "client read request" (either admin REST API or dynamic client registration read request) will need to return new client secret. But that may not be possible due the secret hashing proposal in the other discussion?
Currently we have some "hybrid", which works in a way that:
Regarding support for "set", the client management specification [2] does not allow clients to set their own secret. According to https://datatracker.ietf.org/doc/html/rfc7592#section-2.2 :
Currently we do not support "set" for client management, however we support it for REST API. That is maybe bit strange (even if formally it does not break specification). On the other hand, skip possibility for "set" in admin REST endpoint will break backwards compatibility and will require really lots of test changes. In shortcut: I am fine with keep current behaviour (regenerate in admin console, "set" support in REST endpoint only), but just wanted to doublecheck this... [1] https://openid.net/specs/openid-connect-registration-1_0.html |
Beta Was this translation helpful? Give feedback.
-
One thing to note about a time based expiration is that it will be good for some use-cases, but for others it could possible lead to problems, especially in complex distributed systems. Communication links can be down and this might mean a system might keep using the old password for longer than the predicted expiration time that is set on the secondary secret (say if it's in minutes).. So, keycloak should also offer the user the ability to take control of the retirement of the old/second secret explicitly (i.e. expose a specific API call to retire the old secret for example). |
Beta Was this translation helpful? Give feedback.
-
Reading through the discussions so far I'm quite inclined to think of a simpler solution. Here's a draft flow I've built based on what's been discussed so far (or at least as I understand it).
|
Beta Was this translation helpful? Give feedback.
-
I've added an alternative proposal here: #9156 This introduces a realm level client secret policy instead of having the options at the client API level. I believe this is a far better approach than this one. |
Beta Was this translation helpful? Give feedback.
-
Hi, is there any update on this topic? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Rejected in favour of #9156
Alternative proposal here: #9156
Best practices require secrets to be rotated on a regular basis. This is currently difficult to achieve since its not possible to seamlessly rotate client secrets as a client can only have a single secret at a time. This results in having to synchronously update both the client secret in Keycloak and in the application at the same time, which is in most cases very hard, if not impossible to achieve.
To support seamless rotation of client secrets Keycloak should support the ability to have a primary and a secondary secret for a client. In addition it should be possible to set an expiration time on the secondary secret.
When updating the client secret the Admin Console and Admin APIs should have the following options:
JIRA: https://issues.redhat.com/browse/KEYCLOAK-14567
Beta Was this translation helpful? Give feedback.
All reactions