Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontchannel logout problem #47

Open
vanrar68 opened this issue May 5, 2020 · 3 comments
Open

Frontchannel logout problem #47

vanrar68 opened this issue May 5, 2020 · 3 comments

Comments

@vanrar68
Copy link

vanrar68 commented May 5, 2020

The way Keycloak is chaining the WSFED logout requests when a user is connected to multiple WSFED clients can lead to the user not being disconnected from some of these clients.

Imagine the following scenario:

  • a user is connected to 3 WSFED clients
  • the user clicks on the logout link in Client1
  • Client1 sends wa=signout1.0&wreply=LandingPage to Keycloak
  • Keycloak sends (via browser redirect) wa=signoutcleanup1.0&wreply=keycloakurl to Client2
  • Client 2 redirects the browser to Keycloak
  • Keycloak sends (via browser redirect) wa=signoutcleanup1.0&wreply=keycloakurl to Client3
  • Client 3 redirects the browser to Keycloak
  • Keycloak redirects the browser to Client1 landing page

This is how things are supposed to work in a frontchannel logout scenario (exactly like for SAML but without the token)
The problem is that a few well known WSFED clients (namely Microsoft Sharepoint and Exchange OWA) won't make use of the wreply parameter when receiving a wa=signoutcleanup1.0 request. Keycloak will never get a chance to trigger a logout request directed at Client2 and Client3.
In the above scenario this means that after clicking the "logout" link in Client1, the user will still have a valid session in Client2 and Client3 and even worse, will have no clue about it.

A solution would be the following scenario:

  • a user is connected to 3 WSFED clients
  • the user clicks on the logout link in Client1
  • Client1 sends wa=signout1.0&wreply=LandingPage to Keycloak
  • Keycloak sends a response containing an iFrame pointing to Client2.logoutURL and an autoload form pointing to himself
  • Keycloak sends a response containing an iFrame pointing to Client3.logoutURL and an autoload form pointing to himself
  • Keycloak redirects the browser to Client1 landing page

This way the logout requests initiated by Keycloak are independent of the client behaviour.
Ideally, upon receiving a wa=signout1.0 request Keycloak could send a single response containing multiple iFrames pointing to the connected clients logout URLs in order to trigger all logouts in the same request (just like ADFS does) but that would require changes at Keycloak level.

I've implemented and tested this successfully with Sharepoint. I can submit a PR with both the current behavior and the iFrame logout as an alternative. Let me know

@vanrar68
Copy link
Author

vanrar68 commented May 6, 2020

FYI the logout chaining problem is described in section 4.2 and in section 13.1.2 of the WSFED specs.

@fperot74
Copy link

Ideally, it would be great to have a toggle button to enable serial (like for SAML) or parallel (iframe) logout mechanism.
Anyway, your PR would be welcomed...

@vanrar68
Copy link
Author

I'll submit a PR for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants