Hello everyone. It has been over a month that I am trying to set user session limit for 1 session on keycloak 17. I’ve tried every combination I have found on internet, be it from forum or official documentation, still it does not work. What can be the cause? Thank You
Without knowing what you did/tried, we can’t help that much.
If you can post the config of your auth flow here, perhaps(!) we can help.
Sorry can’t post images, but I made config like the one in documentation Server Administration Guide , however I’ve tried many different combinations I can’t even recall them all, I had session limiter in every subflow, but keycloak keeps adding new sessions.
KC17 user session limiter does not work · keycloak/keycloak · Discussion #25334 · GitHub here are the images of my config
Found this flow that helped me:
SSO Version
-
From the Keycloak sidebar, click Authentication.
-
Click New on the Flow Definition page.
-
Name the new flow, set the flow type to generic and click Save.
-
Click Add Execution on the Actions menu.
-
Click User Session Count Limiter if the limit should be applied to a single user. Click Realm Session Count Limiter if the limit should be applied to a group of users.
-
Return to the flow page.
-
Set the execution you just created to Required and click Config from the Actions menu in the same line.
-
Create a name for the execution and configure the authenticator. For User Session Count Limiter, you can select Deny new session or Terminate oldest session as the desired behavior.
-
From the sidebar, click Identity Providers and click your SSO provider.
-
Open the Post Login Flow menu and click the flow you just created.
-
Click Save.