When new tokens are get in Keycloak, previous sessions are not closed

234 Views Asked by At

A new session is created every time I get tokens from Keycloak. Every time I get a token, I want the previous sessions to be closed. I have not seen such a service on the Keycloak side. What method can be developed for this?

Keycloak version: 19.0.0

I get the token in this way;

URL: http://keycloak_url/realms/{realm}/protocol/openid-connect/token

body

username:{username}
password:{password}
client_id:{client}
grant_type:password
1

There are 1 best solutions below

0
kernel On BEST ANSWER

The problem was fixed by adding the "User Session count limiter" step to the "direct grant" flow on the authentication page in the Keycloak interface.

enter image description here