【问题标题】:How will the SameSite cookie extension changes in Chrome 80 affect Identity Server 4 users?Chrome 80 中的 SameSite cookie 扩展更改将如何影响 Identity Server 4 用户?
【发布时间】:2020-04-07 21:17:58
【问题描述】:

Barry Dorrans 有很好的 page 记录 Chrome 80(和其他)即将对同一站点 cookie 扩展进行的更改,以及它可能如何影响基于 .net / .net 核心的 Web 应用程序中的 OpenIdConnect 身份验证流。
Chrome 80 中的 SameSite cookie 扩展更改将如何影响 IdentityServer4 用户? 当前身份服务器用户需要采取什么行动(如果有)来应对即将到来的 cookie 行为变化?当前运行 IdentityServer4 2.13,带有 authcode 和隐式流。

【问题讨论】:

标签: cookies identityserver4


【解决方案1】:

您将在 Google Chrome 中遇到控制台冲突,并且您的身份服务器无法重定向到可能是适用于 Chrome 版本 80 的 React 应用或 Angular 应用的客户端。

与资源关联的 cookie 设置为 SameSite=None,但未设置 Secure。它已被阻止,因为 Chrome 现在只提供标记为 SameSite=None 的 cookie,前提是它们也标记为 Secure。您可以在 Application>Storage>Cookies 下的开发人员工具中查看 cookie,并在 https://www.chromestatus.com/feature/5633521622188032 上查看更多详细信息。

要解决此问题,您需要在下面的链接中进行更改 -

https://www.thinktecture.com/en/identity/samesite/prepare-your-identityserver/

注意:对于 .Net Core 2.2,设置 SameSite = (SameSiteMode)(-1) , 对于.Net Core 3.0 或以上版本,设置 SameSite = SameSiteMode.Unspecified

另外,对于 Chrome 80 版本,添加这个额外的条件 -

 if ( userAgent.Contains("Chrome/8"))
            {
                return true;
            }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-12-10
    • 2020-06-21
    • 2020-03-14
    • 2019-01-14
    • 2019-05-06
    • 1970-01-01
    • 1970-01-01
    • 2020-02-14
    相关资源
    最近更新 更多