signoutRedirect does not work if called in less than 30 seconds after log in
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. Executeng 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
are you able to reproduce this in our samples?
@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.
are you able to reproduce this in our samples? I can't do anything if I can't identify/repro the issue.
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:
- Set revokeAccessTokenOnSignout: true, and prompt = 'login'
- In the logout(), I included calls to these functions: revokeAccessToken(), removeUser() and then signoutRedirect()