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

itz*_*ush 5 iframe azure-ad-msal

我正在浏览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 试图将 google/twitter 链接添加到应用主页的 iframe src 中(这显然是不允许的)。

在成功获取 access_token 的情况下,我看到 iframe src 有一个 microsoft 登录链接(https://login.microsoftonline.com ...)。

有人能帮我理解为什么会这样吗?如果有人有办法解决这个问题,请帮助我。

我没有更改代码中的任何内容,我只是想了解 msal.js 是如何工作的,以便我可以在另一个项目中实现它。