如何解决登录到Identity Server 4可以在Edge,Firefox和Opera上运行,但不能在Chrome上运行
我正在将Identity Server 4与Umbraco一起使用。当我从Edge,Firefox或Opera本地登录(本地主机)时,登录正常。如果我从Chrome浏览器尝试登录,将失败。
在Identity Server 4日志中,唯一的区别似乎是CORS请求行出现在Chrome中,而不是其他浏览器
[DBG] umbraco found in database: true
[VRB] Calling into client configuration validator: IdentityServer4.Validation.DefaultClientConfigurationValidator
[DBG] client configuration validation for client umbraco succeeded.
---> [DBG] CORS request made for path: /Account/Login from origin: null but was ignored because path was not for an allowed IdentityServer CORS endpoint
[VRB] No endpoint entry found for request path: /Account/Login
[VRB] returnUrl is valid
[DBG] Start authorize request protocol validation
[DBG] umbraco found in database: true
对于Edge,Firefox和Opera,我得到了
[DBG] User in authorize request: 1932942018
在Chrome浏览器中我得到
[DBG] No user present in authorize request
谁能告诉我从哪里开始寻找? 这是Chrome问题吗? 与使用本地主机相关的东西? 仅在Chrome中显示IS4的配置问题?
在Windows 10专业版上使用Identity Server 4 v4.0.4
解决方法
有关如何处理Chrome和SameSite Cookie的信息,请参见此article
我还将尝试禁用SameSite处理,只是为了验证它是否是问题。有关如何禁用它的详细信息,请参见此article。
,在Edge从Edge Legacy升级后,如果其他任何人遇到相同的问题,这里有一个解决方法:
需要新的注册表项:
Computer \ HKEY_CURRENT_USER \ Software \ Policies \ Microsoft \ Edge \ LegacySameSiteCookieBehaviorEnabled
DWORD的值设置为1
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。