Hi Team,
I have two projects running — one in Remix and one in Superset. I’m using Keycloak for authentication, and in both projects I manage sessions through browser cookies. Once a user logs in to my app via Keycloak, I create a session and store it in the browser for further request authorization. SSO login across both apps is working fine.
The challenge I’m facing is with logout. I want to achieve single logout so that logging out from one app logs the user out from all other applications in real time. I’ve explored both front-channel and back-channel logout, but haven’t found a concrete solution yet.
Below are my observations so far:
API Session Validation
Implement session validation by calling the Keycloak API on every request.
Limitation: This would add multiple API calls to the server, impacting performance.
Redis-based Session Management
Store session data in Redis instead of browser cookies. Each request can then be validated against Redis.
Limitation: If Redis becomes unavailable, the login flow will be completely blocked.
Front-Channel Logout
Keycloak uses iframes to trigger logout URLs for each client.
Limitation: Fragile due to iframe-related issues (third-party cookie blocking, CSP, X-Frame-Options, browser privacy restrictions).
Back-Channel Logout
Works via server-to-server logout notifications.
Limitation: This is not effective in my current setup since sessions are stored only in browser cookies, and the server has no visibility into them.
I’d like to know what would be the recommended approach to manage sessions and implement a robust single logout flow in this scenario. Any best practices or industry-standard approaches would be very helpful.
Thanks,
Atul
Hi Team,
I have two projects running — one in Remix and one in Superset. I’m using Keycloak for authentication, and in both projects I manage sessions through browser cookies. Once a user logs in to my app via Keycloak, I create a session and store it in the browser for further request authorization. SSO login across both apps is working fine.
The challenge I’m facing is with logout. I want to achieve single logout so that logging out from one app logs the user out from all other applications in real time. I’ve explored both front-channel and back-channel logout, but haven’t found a concrete solution yet.
Below are my observations so far:
API Session Validation
Implement session validation by calling the Keycloak API on every request.
Limitation: This would add multiple API calls to the server, impacting performance.
Redis-based Session Management
Store session data in Redis instead of browser cookies. Each request can then be validated against Redis.
Limitation: If Redis becomes unavailable, the login flow will be completely blocked.
Front-Channel Logout
Keycloak uses iframes to trigger logout URLs for each client.
Limitation: Fragile due to iframe-related issues (third-party cookie blocking, CSP, X-Frame-Options, browser privacy restrictions).
Back-Channel Logout
Works via server-to-server logout notifications.
Limitation: This is not effective in my current setup since sessions are stored only in browser cookies, and the server has no visibility into them.
Hi Team,
Thank you for your response. Currently, I manage sessions using browser cookies only. I’m new to server-side session management and am considering moving to using Redis as a session store. I have a few questions and would really appreciate your guidance:
How do organizations handle logins if the Redis server is unavailable? Are there recommended fallback strategies?
Is storing session data on the server side a good approach in terms of scalability, reliability, and security?
Are there best practices for session persistence and handling high traffic when using Redis for session management?
Thank you in advance for your help!
Best regards,
Atul
--
You received this message because you are subscribed to the Google Groups "Keycloak User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keycloak-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/keycloak-user/1e0bfd9f-4c46-420e-8b5a-39cd2268af2dn%40googlegroups.com.