Frontchannel logout not working as expected #85
Replies: 4 comments 3 replies
-
Browsers get more and more restricted with cross site requests. That's why unfortunately the usability of front-channel logout is decreasing. Can you please try your scenario with different browsers and see if others work? |
Beta Was this translation helpful? Give feedback.
-
In Chrome's devtools when clicking on a request in the network tab there's a cookie tab. Can you enable "Filtered out request cookies" there and see if the cookie is blocked somehow and for what reason? |
Beta Was this translation helpful? Give feedback.
-
Thanks for all the details. Looking at them this probably still is a issue with the browser not allowing access to local storage with a cross-site request. The only solution would be, also in the long run because browsers are getting more and more restricted, to either run the Angular application same-site or switch to the BFF pattern and use backchannel logout. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answers! Unfortunately the whole point of this part of the demo is to demonstrate that a BFF and a non-BFF application can work together with SSO, which I am now doubting is possible. :( Do you think maybe something like this could work?
This kind of feels like it's a hacky solution, is this common practice? Also, if front-channel logout doesn't work in general, and what I described above is not common practice, then doesn't this imply that any application that supports SSO also has to implement BFF in order for global logout to work? |
Beta Was this translation helpful? Give feedback.
-
IdentityServer version
7.0.4
.NET version
8
Description
Hi!
I am working on a POC, that is meant to be a demo about how SSO and BFF can work together using Duende. There are 8 simultaniously running processes in the demo (Most of these components are not relevant to my problem, but for sake of completeness I will list them here):
My goal is to implement
What I implemented so far mostly works fine, however I have an issue with the global logout, specifically with notifying the client of the non-BFF app that a logout happened. For the BFF applications the logout notification is sent using backchannel logout, however I can't do that with an application that doesn't have a BFF component. If I understand correctly from the docs, the way to notify the client in this case is to use frontchannel logout (https://docs.duendesoftware.com/identityserver/v7/ui/logout/notification/). I implemented a page called
/signout-oidc
in the non-BFF client, that logs the user out upon loading the page:I use the angular-oauth2-oidc library.
I have the identity server on port 5000, and the no-BFF client on port 4203.
So this is how it works now:
/signout-oidc
of the clientThe problem I am having happens in this step: Even though the code angular component is executed (Both "Signing out..." and "Signed out." are logged, no exceptions are thrown), my client is not getting logged out - it does not delete the token locally. Hovewer if I just copy the
src
of the iframe, and I directly query that page in a new browser tab, it then correctly deletes all tokens, and the logout completes.I want the non-BFF client to be correctly notified of the logout, so it can invalide it's local storage.
What I suspect the bug is:
The localstorage/sessionstorage is seperate for localhost:5000 and localhost:4203, and even though the iframe uses a source that is on localhost:4203, it still can't access the local storage on that port.
However, if this is the case, then frontchannel logout shouldn't work in general at all, becasue the identity server wouldn't be able to notify, or share any data whatsoever with the other clients this way. That is why I think there is a common way to do this that I can't seem to find or figure out. Is it possible this is a bug?
I would appreciate any help or advice you have regarding this problem.
You can view the full source code here
Reproduction steps
Expected behavior
Upon singing out from any client, the non-BFF client gets notified and correctly deletes all data stored about the token for the current session.
Logs
No response
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions