oidc-client-js icon indicating copy to clipboard operation
oidc-client-js copied to clipboard

signoutRedirect does not work if called in less than 30 seconds after log in

Open AlexeyRokhin opened this issue 8 years ago • 4 comments

I'm using oidc-client in combination with identityserver. UserManager.signoutRedirect does not always redirect to identityserver. It redirects only if called after 30 seconds after login.

  • Ensure that you have node, npm and angular cli 1.5+ installed.
  • Open console. Go to Publishers.Sts directory. Execute dotnet run.
  • Open console. Go to Publishers.Angular2 directory. Execute npm install. Execute ng serve.
  • Open browser (chrome). Go to http://localhost:4200
  • Execute scenarios described on the home page:
Successful scenario
  Click Login
  See login page of identity server
  Enter credentials to authenticate and return to application
  Wait for 30+ seconds after 2nd page reload
  Click users'name and logout
  See logout page of identity server

Unsuccessful scenario
  Click Login
  See login page of identity server
  Enter credentials to authenticate and return to application
  Wait for 25 seconds after 2nd page reload
  Click users'name and logout
  See that nothing happens
  To repeat, remove cookies, sessionStorage and refresh a page

Most of authentication logic resided in AuthService: Publishers.Angular2\src\app\auth\services\auth.service.ts

Test project attached. Publishers2.zip

AlexeyRokhin avatar Dec 13 '17 23:12 AlexeyRokhin

are you able to reproduce this in our samples?

brockallen avatar Jan 10 '18 14:01 brockallen

@brockallen I think this is an issue worth investigating as I am also seeing a similar behaviour.

I have some scenario where I 'force' logout shortly after user logs in and somehow application endsup redirecting to "https://authority.example.com/null" where "https://authority.example.com" is the authority i set up the UserManager.

ghost avatar May 22 '18 13:05 ghost

are you able to reproduce this in our samples? I can't do anything if I can't identify/repro the issue.

brockallen avatar May 22 '18 17:05 brockallen

Thanks for posting this question. The problem I'm having with "signoutRedirect()" when the project has multiple NavBar pages that contain "Sign-Out" links for the user to click. The Default page that allows users to SignIn and SignOut did not have any issues with the "signoutRedirect()". However, when the user is authenticated and redirected to an admin dashboard page that has the 2nd NavBar page with the option for the user to SignOut - calling the "signoutRedirect()" from the auth.service.ts will not redirect to IdentityServer's logout page. I'm not sure if I'm doing this correctly but I did the following:

  1. Set revokeAccessTokenOnSignout: true, and prompt = 'login'
  2. In the logout(), I included calls to these functions: revokeAccessToken(), removeUser() and then signoutRedirect()

nivre avatar Dec 02 '18 01:12 nivre