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

Await Logout till endSession is complete in logout #1298

Open
pgangwani opened this issue Feb 14, 2024 · 10 comments
Open

Await Logout till endSession is complete in logout #1298

pgangwani opened this issue Feb 14, 2024 · 10 comments

Comments

@pgangwani
Copy link

pgangwani commented Feb 14, 2024

Issue and Steps to Reproduce

In logout we have below steps

  1. revoke access token
  2. revoke refresh token
  3. endsession (idtoken)
  4. Either soft redirect / refresh the session or
  5. or redirect to oidc server logout url

As 4 or 5 are exclusive steps , I am expecting async logout to await till all promises resolve including endSession.
I am thinking to get below case worked

Screenshot 2024-02-14 at 2 30 21 PM

Currently what is happening that if I am writing the window.location.href after await of logout, endSession request is cancelled. I need to redirect to logout to kill the session fully as per our oidc server. Attached below screenshot

Versions

7.18.1

Screenshots

Screenshot 2024-02-20 at 10 10 58 AM

Expected

Await(revoke(AT), revoke(RT), endSession(idToken)).then (() => custom redirect);

Actual

Await(revoke(AT), revoke(RT)).then (() => custom redirect);
and endSession(idToken) is cancelled

Additional Details

PLease let me know if I am missing something

  • Installed packages:
@pgangwani pgangwani changed the title Await till endSession is complete Await till endSession is complete in logout Feb 14, 2024
@pgangwani pgangwani changed the title Await till endSession is complete in logout Await Logout till endSession is complete in logout Feb 14, 2024
@guillaume-chervet
Copy link
Contributor

Hi @pgangwani ,

Thank you for your issue.
I think it is due to the window.open. i have understand what to fix. I may do it tommorrow morning.

@pgangwani
Copy link
Author

Hi @pgangwani ,

Thank you for your issue. I think it is due to the window.open. i have understand what to fix. I may do it tommorrow morning.

Thanks, I willl be waiting

@guillaume-chervet
Copy link
Contributor

I forgot to tell you @pgangwani that version 7.18.3 should fix the bug :)

@pgangwani
Copy link
Author

I forgot to tell you @pgangwani that version 7.18.3 should fix the bug :)

I will give it a test

@pgangwani
Copy link
Author

pgangwani commented Feb 19, 2024

@guillaume-chervet
I tested above, it is redirecting to the post_redirect_uri after logout but not to the oidc server logout page as it is happening in https://black-rock-0dc6b0d03.1.azurestaticapps.net/. Is there a setting in oidc to goto loggedout page ? I actually wanted endSession to be called and then await to be resolved so that I can manually redirect to logout of the oidc server. Thoughts?

@guillaume-chervet
Copy link
Contributor

hi @pgangwani , does you oidc server support endSessionEndpoint ?

if (oidcServerConfiguration.endSessionEndpoint) {

@pgangwani
Copy link
Author

hi @pgangwani , does you oidc server support endSessionEndpoint ?

if (oidcServerConfiguration.endSessionEndpoint) {

Yes it does.
Screenshot 2024-02-20 at 9 55 20 AM

@pgangwani
Copy link
Author

pgangwani commented Feb 20, 2024

I need to understand what is the extra setting required at OIDC server level ? How is your example app using duende redirecitng to duende's logout with just mention of post_redirect_uri: '/profile' ?

@guillaume-chervet
Copy link
Contributor

Hi @pgangwani , some extra are defined as oidc standards and some other are specific to some oidc provider.

Do you still have some problem with logout?

@pgangwani
Copy link
Author

provider

My problem was solved by my own hack of await logout();redirect(logoutUrl) but organically logging out like in your example. For which I raised this issue.

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