【问题标题】:CSP issues with checksession using oidc-client.js使用 oidc-client.js 的检查会话的 CSP 问题
【发布时间】:2017-11-22 21:28:50
【问题描述】:

我正在使用 oidc-client 构建一个 SPA,以登录到使用 Identity Server 4 构建的 IDP。

登录重定向似乎工作正常,但在 Firefox 上我遇到了以下 CSP 问题

Content Security Policy: Ignoring "'unsafe-inline'" within script-src or style-src: nonce-source or hash-source specified  (unknown)
Content Security Policy: The page's settings blocked the loading of a resource at self ("script-src 'unsafe-inline' 'sha256-VDXN0nOpFPQ102CIVz+eimHA5e+wTeoUUQj5ZYbtn8w='"). Source: !function(t){function __webpack_require_....  checksession:1
Content Security Policy: The page's settings blocked the loading of a resource at self ("script-src 'unsafe-inline' 'sha256-VDXN0nOpFPQ102CIVz+eimHA5e+wTeoUUQj5ZYbtn8w='"). Source: window.devToolsOptions = Object.assign(w....  checksession:1
Load denied by X-Frame-Options: http://localhost:5007/home/error?errorId=a74accc61bb821ee1f42f7013a306e90 does not permit cross-origin framing.  (unknown)

我没有在我的 SPA 上设置任何 CSP 元标记,我想知道是否必须这样做。 稍微挖掘一下,oidc-client 似乎在我的应用程序中添加了一个 iframe,它指向 Identity Server 中的 checksession 页面(其中确实包括 CSP 标头“default-src 'none'; script-src 'unsafe-inline' ” sha256-VDXN0nOpFPQ102CIVz+eimHA5e+wTeoUUQj5ZYbtn8w='")

有人可以帮我解决这个问题或引导我走向正确的方向吗?我对 CSP 的了解非常基础。

【问题讨论】:

标签: javascript identityserver4 content-security-policy openid-connect oidc-client-js


【解决方案1】:

这是 Redux devtools 插件试图在页面上注入他们的代码。

【讨论】:

    猜你喜欢
    • 2019-02-15
    • 2022-07-28
    • 2018-05-25
    • 1970-01-01
    • 1970-01-01
    • 2019-01-23
    • 2013-12-17
    • 1970-01-01
    • 2019-02-09
    相关资源
    最近更新 更多