小编itz*_*ush的帖子

推特的 Msal.js iframe 问题,同时从多个谷歌帐户中进行选择

我正在浏览JavaScript 的AzureAD msal 库。我尝试运行同一个 github 链接中给出的测试应用程序

该应用程序可通过 facebook 或 microsoft 帐户登录顺利运行。但是当我尝试使用 twitter 登录时,它会引发以下错误:

Refused to display 'https://api.twitter.com/oauth/authenticate?oauth_token=....' in a frame because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://tweetdeck.twitter.com https://tdapi-staging.smf1.twitter.com https://tdapi-staging.atla.twitter.com https://tweetdeck.localhost.twitter.com". 
Run Code Online (Sandbox Code Playgroud)

此外,当我在浏览器中登录一个google 帐户或在 google 登录页面上输入 google 凭据时,该示例运行良好。但是当我登录多个谷歌帐户并为应用程序选择其中一个帐户时,它会引发以下错误:

Refused to display 'https://accounts.google.com/o/oauth2/auth?.....' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Run Code Online (Sandbox Code Playgroud)

在这两种情况下(twitter 和多个 google 帐户),都会发生登录,生成 id 令牌,但无法使用 access_tokenacquireTokenSilent()并引发上述错误。然后由于acquireTokenpopup(),登录弹出窗口再次显示,当我再次输入相同的凭据时,我得到了 access_token。

我曾尝试使用loginRedirect()&acquireTokenRedirect()而不是 popup,但我看到了相同的行为。

到目前为止我所理解的: …

iframe azure-ad-msal

5
推荐指数
0
解决办法
773
查看次数

标签 统计

azure-ad-msal ×1

iframe ×1