IdentityServer4 icon indicating copy to clipboard operation
IdentityServer4 copied to clipboard

Checksession is not sending the cookies to the identity server,

Open muralisambu opened this issue 6 years ago • 8 comments

Hi,

tried multiple times, check session is not able to send the cookies after logged in and the application is logged out. checked multiple sites to change the cookie samesite attribute to none, Cookiesecurepolicy to always(secure) but still no luck.

Identity server4 2.2.0 and aspnetcore 2.0.3 image

muralisambu avatar Apr 09 '20 09:04 muralisambu

Well - this looks like a SameSeit cookie issue. Also keep in mind that we can only support the latest IdentityServer/ASP.NET Core versions.

Generally speaking - check session will not work reliably anymore.

https://leastprivilege.com/2020/03/31/spas-are-dead/

leastprivilege avatar Apr 09 '20 11:04 leastprivilege

@leastprivilege Thanks for the response, if I upgrade to latest identity server 3.1.2 and aspnet core to 3.1 will it work or do i need to do any changes to make it work?

muralisambu avatar Apr 09 '20 11:04 muralisambu

@muralisambu I'm not sure if we're talking about the same issue, but in order to get the Quickstart projects to work today in 3.1, all I had to do was make everything HTTPS. I was really pissed off at first because the MVC to IdP Quickstart solution didn't work from the latest code in github, but then I realized it might have something to do with SameSite cookies and switched to HTTPS. I would suggest the team retest and update those projects accordingly. Note that you can turn on and off those "SameSite" features in chrome (for testing purposes) here: chrome://flags/ Here's another good link to read that solved the problem with my super old version of identityserver: https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/

justincts1975 avatar Apr 09 '20 20:04 justincts1975

https://github.com/IdentityServer/IdentityServer4/blob/master/src/IdentityServer4/host/Extensions/SameSiteHandlingExtensions.cs

leastprivilege avatar Apr 10 '20 06:04 leastprivilege

After set right SameSite value, you may need check browser settings.

  • Chrome settings -> privacy and security -> Site Settings -> Cookies and site data

If Block third-party cookies is checked, please add you OP domain into Allow list

tai-yi avatar Apr 16 '20 09:04 tai-yi

If Block third-party cookies is checked, please add you OP domain into Allow list

this setting will sooner or later become the default value for all browsers. The check session mechanism will not work reliably anymore if client and OP are cross-site.

https://leastprivilege.com/2020/03/31/spas-are-dead/

leastprivilege avatar Apr 16 '20 10:04 leastprivilege

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Questions are community supported only and the authors/maintainers may or may not have time to reply. If you or your company would like commercial support, please see here for more information.

stale[bot] avatar Apr 30 '20 11:04 stale[bot]

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Nov 27 '20 00:11 github-actions[bot]