【问题标题】:MSAL js - acquireTokenSilent fails with X-Frame-ErrorMSAL js-acquireTokenSilent 失败并出现 X-Frame-Error
【发布时间】:2020-05-21 15:28:53
【问题描述】:

我们正在为 React SPA Web 应用程序和 API 使用 Azure AD B2C,我们使用 b2c 自定义策略来支持 azure 多租户登录,它适用于本地帐户和 google 登录,但是当使用任何 azure 帐户登录时,获取 iframe来自 msal.js 的错误

网站网址https://app.skypointcloud.com

复制步骤 - 使用任何 Azure 帐户登录

错误

Refused to display 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=b85d50b8-7e2f-xxxxx-xxxxx&redirect_uri=https%3a%2f%2fsicdpstage.b2clogin.com%2fsicdpstage.onmicrosoft.com%2foauth2%2fauthresp&response_type=code&scope=openid+profile&response_mode=form_post&nonce=xxxxxx&state=StateProperties%3xxxxx' in a frame because it set 'X-Frame-Options' to 'deny'.

【问题讨论】:

  • 如果您在新标签页中打开链接,您可能会看到一个帐户选择屏幕?

标签: azure-ad-b2c msal react-aad-msal


【解决方案1】:

目前这个问题是由 B2C 服务引起的,而不是图书馆。发生这种情况时能否尝试调用acquireTokenPopup 或acquireTokenRedirect。

类似的请参考issue

【讨论】:

  • acquireTokenPopup/acquireTokenRedirect 的问题是它会弹出或重定向用户再次登录流程
  • acquireTokenPopup 确实有效,但被浏览器阻止
猜你喜欢
  • 2020-10-16
  • 2021-12-13
  • 2018-01-24
  • 1970-01-01
  • 2020-01-23
  • 1970-01-01
  • 1970-01-01
  • 2016-12-13
  • 1970-01-01
相关资源
最近更新 更多