Search code examples
redhatkeycloakkeycloak-services

Keycloak Permissions not working


I'm using Admin Rest API + Resource management(Protection API) for managing resources and Keycloak UI for CRUD for permissions. And Entitlement API and Introspect API for checking the user permissions.

Tried to create and delete same permissions multiple time, after that permission is not working.

After restarting the keycloak server, it started working again.

I'm using AWS docker container service for keycloak.

Steps to reproduce:

  1. Created permissions P1 (Check permission it is working fine)
  2. Deleted permission P1 (Check permission it is working fine)
  3. Again Created permission P1 (Not working this time)
  4. After restarting the server, it starts working.

How to fix this?


Solution

  • It was a cache issue and resolved using API https://www.keycloak.org/docs-api/3.0/rest-api/index.html#_clearkeyscache

    Cache can also cleared from settings tab.