Closed tiwari-abhishek closed 7 years ago
This is probably due to the deadlock in the Microsoft ws-fed middleware. You can fix this by putting your own config manager, like this: https://github.com/IdentityServer/IdentityServer3/blob/master/source/Host.Configuration/IdentityServerExtension.cs#L130
Thanks Brock. That worked perfectly!
Question / Issue
To begin with, this might not even be an Identityserver issue. However this is easily reproducible. Steps:
Since I had logged in before code change and still have my browser open, I still have the cookie and can reach the permissions page and see the applications I consented to. At this point, if I try to logout, the "/connect/endsession", it redirects to: https://{{my-ids}}/logout?id=850fef7116ecf9103f032476513ee09e and then never completes. If I restart IIS, even the permissions page redirects to "/login" and just times out.
As a workaround, if I clear the browser cookies and also restart IIS, everything starts working normally. I am able to login and logout.
So it boils down to - Everything works if I remember to logout and clear my cookies before doing any code change/rebuild.
I was fine with the workaround but something like this, of-course without the code change also happened on Azure deployment. Where the /permissions and /logout result in timeout but any static content/pages work. Restarting Azure service is not an option, although it makes things start working again. The Azure failover doesn't work because the IdentityServer is still able to serve other pages (/login, logout)
Below is the event log excerpt from Azure. The is not much information in IdentityServer logs because its probably waiting for IIS to do something with the request before it can log anything. And IIS doesn't return ever.
Let me know if anyone faced something similar or can determine the root cause. It could be a bug in IIS or WsFed plugin as well. Local debug doesn't help, even with all exception types selected in visual studio exception settings. I cant find anything in local event viewer. Basically these requests never come back from IIS.
somebody mentioned it here https://katanaproject.codeplex.com/workitem/409 about updating the Microsoft.IdentityModel.Protocol.Extensions package. That didn't help me. I guess it resolves the issue for IISExpress but doesn't work for IIS.
Relevant parts of the log file