-
Notifications
You must be signed in to change notification settings - Fork 209
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
UserManager signoutRedirect not working #1379
Comments
The migration guide is not mentioning this at all btw. |
Can you verify if that is caused by #1342? |
Yes, reverting the mentioned PR solves my issue. I think the underlying problem is the following: I have not implemented the logout callback functionality in my application. So the signoutRedirectCallback method as well as the _signoutEnd method never get called... |
I have to add, that I originally come from the oidc-client-js lib. So there was actually no real reason to use it. Same goes for the oidc-client-ts library before the last major update. |
I see multiple solutions:
Any other solutions? @PSanetra Would version 2. work for you? I am thinking about reverting, because its dead simple and makes sure that the user is removed and the event is sent at any situation. Maybe version 2. would be a compromise. I no longer like version 3. though... |
@pamapa Please do not revert that PR. I am not sure what the issue is. Is there a case where _signoutEnd is never called? This seems to be generally wrong 😕 Is the client not required to call _signoutEnd somehow? Even if there are existing clients which do not call I would be ok to introduce a flag to the UserManager to configure if such a callback is supported by the client or not. If it is supported, the behavior, introduced by the PR should be maintained, otherwise I would be fine to fall back to the pre-PR behavior, which is prone to race conditions. |
@ch-lepp I guess you can easily implement that callback, |
Yes, I could use the callback. Thank you for your support. |
i have improved the migration document |
|
@PSanetra What concerns me is that when for whatever reason the callback is not called by the IDP (e.g. no valid session), the client stucks in a non fixable state (the user is still stored locally and will not be removed due to the not coming callback). In order to address that we could remove user in |
@pamapa I think defering the notification would also be ok. Our original issue was only caused by a race condition between that event notification handling and the actual logout. As far as I know our application does not directly depend on that internal persistent state. Regarding the local storage state: I did not look deep into the reason why this state is necessary. Might it be possible to completely remove this persistent state? Usually the login flow will anyway work also without such a state, right? Maybe I am missing something, but I think it might be possible to remove the persistent state. |
So tricky, what if we only defer the notify: user is removed (good), but rest of application is not notified -> not good.
Can you move that into a new issue, it is better to track it separately... |
I do not want to enforce the users of this library to implement a callback by default. I am going to revert to the previous 100% reliable behavior. |
Thanks for the fast release :) I was searching for an issue over at https://github.com/authts/react-oidc-context |
This reverts commit 59e6cc6.
To logout I use the signoutRedirect method of the UserManager.
That worked perfectly fine with version 2.4.0.
With version 3.0.0 the user is no longer properly logged out.
oidc-client-ts correctly redirects the user agent to the auth server with id_token_hint and post_logout_redirect_uri.
The auth server performs the logout as usual and redirects the user agent back to the application.
The difference compared to version 2.4.0 is, that the UserManager still holds a user object, accesible by the getUser method.
Causing the issue should be the removal of this line in the _signoutStart method.
Is this a bug or should I change some things in my application?
The text was updated successfully, but these errors were encountered: