【问题标题】:Perpetual Loading永久加载
【发布时间】:2016-04-18 21:41:14
【问题描述】:

我有一个使用 identityserver3 设置的身份服务器,每当我在登录后连接到我的站点时,它就会陷入看起来像永久重定向的情况。

我打开了日志记录,我注意到那里有一些与 CSP 相关的行,这让我认为这是问题所在,但我不知道如何解决它。

2016-01-13 12:43:17.738 -05:00 [信息] 渲染登录页面

2016-01-13 12:43:18.203 -05:00 [信息] 请求 CSP 报告端点

2016-01-13 12:43:18.208 -05:00 [信息] CSP 报告数据:"{\"csp-report\":{\"blocked-uri\":\"self\",\ "document-uri\":\"http://example.com.com:44200/core/login?signin=someGuid\",\"line-number\":1,\"original-policy\":\"default-src http://example.com:44200;脚本源http://example.com:44200; style-src http://example.com:44200 '不安全内联'; img-src *;报告-uri http://example.com:44200/core/csp/report\",\"referrer\":\"\",\"script-sample\":\"try { for(var lastpass_iter=0; lastpass...\",\"source- file\":\"http://example.com:44200/core/login?signin=someGuid\",\"violated-directive\":\"script-src http://example.com:44200\"}}"

2016-01-13 12:43:18.208 -05:00 [信息] CSP 报告数据:"{\"csp-report\":{\"blocked-uri\":\"self\",\ "document-uri\":\"http://example.com:44200/core/login?signin=someGuid\",\"original-policy\":\"default-src http://example.com:44200;脚本源http://example.com:44200; style-src http://example.com:44200 '不安全内联'; img-src *;报告uri http://example.com:44200/core/csp/report\",\"referrer\":\"\",\"script-sample\":\"IMG 元素上的onerror 属性\",\"source-file\":\"@987654333 @\",\"violated-directive\":\"script-src http://example.com:44200\"}}"

2016-01-13 12:43:18.223 -05:00 [信息] CSP 报告数据:"{\"csp-report\":{\"blocked-uri\":\"data:image/png ;base64,someText\",\"document-uri\":\"http://example.com:44200/core/login?signin=someGuid\",\"original-policy\":\"default-src http://example.com:44200;脚本源http://example.com:44200; style-src http://example.com:44200 '不安全内联'; img-src *; report-uri http://example.com:44200/core/csp/report\",\"referrer\":\"\",\"violated-directive\":\"img-src *\"}}"

2016-01-13 12:43:18.226 -05:00 [信息] 渲染 204

【问题讨论】:

    标签: asp.net-mvc identityserver3


    【解决方案1】:

    您可以使用IdentityServerOptionsCSPOptions 属性修改CSP 选项。在此处查找文档:https://identityserver.github.io/Documentation/docsv2/advanced/csp.html

    如果您想测试 CSP 是否是您的问题,您可以尝试使用这些选项完全禁用它。

    查看日志,您可能需要将值 'self' 添加到 ScriptSrc

    【讨论】:

      猜你喜欢
      • 2017-12-29
      • 1970-01-01
      • 1970-01-01
      • 2022-01-11
      • 2022-10-08
      • 2011-03-01
      • 1970-01-01
      • 2021-09-15
      • 1970-01-01
      相关资源
      最近更新 更多