Reputation: 163
Keycloak offers several REST calls to retrieve client or user sessions from it's builtin Infinispan cache. It is also possible to delete sessions via the REST API.
I'd like to know if it is possible to update sessions programmatically in a custom SPI. The Javadoc lists some Infinispan-related methods but it's not clear to me if these can be used for that purpose.
Does anyone know if this can be done, either with the default builtin Infinispan cache, or with an external Infinispan server?
For the time being we are stuck with Keycloak v23.0.7 because we first need to re-build our custom theme to work with v24+.
Thanks!
Upvotes: 0
Views: 105
Reputation: 174
First, make sure there really aren't public admin REST API calls exposed for your use case, by reviewing the reference at https://www.keycloak.org/docs-api/latest/rest-api/index.html
While I am not familiar with what public APIs/SPIs Keycloak actually provides, looking at the linked Javadoc, these do not appear public API/SPI. Which means that things can change without warning in the next version. Nevertheless, you should be able to implement a Keycloak extension to achieve what you need, see linked extensions for reference/inspiration: https://www.keycloak.org/extensions
Upvotes: 1