I'm using keycloak
for authentication and authorization
, I want to get the active session
information of the users or the user, but I couldn't find such information in the docs.
If there is an active session belonging to the user, I want to prevent this user from deleting it, so I need such information.
If we can't get the active session information, I can accept a different alternative answer.
I am using Spring boot
and keycloak version 15.0.2
.
CodePudding user response:
You can get this API
"Get user sessions for client Returns a list of user sessions associated with this client"
GET /{realm}/clients/{sessionId}/user-sessions?first={startIndex}&max={numberUser}
It should be match with Keycloak UI's client session information
Then he/she can't call remove a user session API "Remove a specific user session" DELETE /{realm}/sessions/{sessionId}