我正在通过AzureAD msal library获取javascript . 我试图在同一个github链接中运行test app .

该应用程序与Facebook或微软帐户登录顺利运行 . 但是当我尝试使用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".

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

Refused to display 'https://accounts.google.com/o/oauth2/auth?.....' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

在这两种情况下(Twitter和多个谷歌帐户),登录发生,生成id令牌,但无法使用 acquireTokenSilent() 获取access_token并抛出上述错误 . 然后由于 acquireTokenpopup() ,再次显示登录弹出窗口,当我再次输入相同的凭据时,我得到access_token .

我尝试使用 loginRedirect()acquireTokenRedirect() 而不是弹出窗口,但我看到了相同的行为 .

到目前为止我所理解的:

在错误情况下,iframe尝试将google / twitter链接添加到应用主页中的iframe src(显然不允许) .

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

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

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