-
Notifications
You must be signed in to change notification settings - Fork 162
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
post_logout_redirect_uri during logout and last visited url #1487
Comments
Hi @lomboboo , logout(window.location.origin) should work but You need to declare On your OIDC Server all logout possible URI to make it works. |
@guillaume-chervet there is no way to define all possible URIs because client router is dynamic. So ideally, there should be something like this or this. Is there something like that implemented in your library or something that you're willing to add? |
@lomboboo, youcan easily create you /logout route that redirect to the path where your user log out. Juste save for exemple the /path in the session state before calling oidc logout method. |
Do I understand correctly, you suggest saving last accessed url during |
Issue and Steps to Reproduce
Trying to evaluate this package for our needs instead of
oidc-client-ts
. Your package has a very clever solution to the refresh token flow problems, so kudos to all involved!I mostly got everything working except during logout, by default
post_logout_redirect_uri
is set to the current path from the window location. In my understand it should be a part of the ODIC configuration as a required property.Instead, when
logout()
called is setspost_logout_redirect_uri
to the current path and fails validation with IdentityServerClientPostLogoutRedirectUris
table ending up on the Logout page in IdentityServer with no redirection back.Since there is no
post_logout_redirect_uri
in the ODIC configuration, I am callinglogout(window.location.origin)
so thatpost_logout_redirect_uri
matches with my IDS4 configuration, but now I am not sure how to redirect user to the page he was logged out from. I image it would be something likeoidc-client-ts
does, setting state withlastUrl
or smth and storing it somewhere in localstorage. Then retrieve it in some event or creating special route for post logout url - not sure, but I can't find any examples of how to do this correctly or maybe it's already implemented in some way and I couldn't find it.My goal here is during any logout user should be redirected back to the page he was logged out from after re-login.
Versions
oidc-client - Latest
IdentityServer4 - 3.1.0
The text was updated successfully, but these errors were encountered: