Keycloak client policies through extension

46 Views Asked by At

I have a keycloak extension that creates a client. This extension also sets a secret for the client. My keycloak has a client policy that says all clients that have a role "rotation-policy" should have a client policy applied to them to rotate client secrets after some predefined time. This works when I create a client from my keycloak UI, apply role and regenerate the secret but not when done through my extension (my extension applies the role and creates the secret). How do I get the policy to be applied from my extension as well?

I noticed that the regenerate secret button emits an Admin Event so I attempted to mimic this and send an admin event from my extension but that doesn't work as well.

0

There are 0 best solutions below