[keycloak-user] understanding cache and user storage SPI

Corbetta, Francesco fco at iec.ch
Tue May 22 09:21:50 EDT 2018


Hi all

I implemented a User Storage SPI in order to authenticate users against my company User Relational DB.
Lately I had to add some custom attributes and therefore I overridden the method getAttributes of the UserAdapter to make it load the correct entities.

The problem I had is that it did not work till when I changed the cache policy of the storage provide to NO_CACHE.

Before that, the attributes where not loaded and no sql statement were sent to the DB.
Please note that I also restarted the application server with no success and cleaned all the cache for the realm from the admin interface.

Is this the expected behaviour? How does it work the user cache for external user provider? How is it possible that even a restart of keycloak did not erased the cache?

Best regards

Francesco



More information about the keycloak-user mailing list