【问题标题】:Azure AD signout redirect url error “X-Frame-Options“ directive set to “DENY“Azure AD 注销重定向 url 错误“X-Frame-Options”指令设置为“DENY”
【发布时间】:2022-08-14 18:01:44
【问题描述】:

“https://login.microsoftonline.com//oauth2/v2.0/authorize?response_type=code&client_id=&scope=openid%20profile%20offline_access%20https://graph.microsoft.com/User.Read%20api”的加载://88730ebd-6d43-490e-bf63-56f62c567580/access_as_user&state=QKtRP3dhjo3cwQR_mfQ35UPbNfDtr1lrrqepRy0VpgI%3D&redirect_uri=https://ipv5-dev.insights.pwc.com/ip-core-azure-ad-service/login/oauth2/ =xwXhlKO89Drh4m3P6qgSNWvroFAscaLR-AImtF-RKSc” 在frame is denied by “X-Frame-Options“ directive set to “DENY“. authorize

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如它目前所写的那样,很难准确地说出你在问什么。

标签: azure azure-active-directory azure-ad-b2c


【解决方案1】:

发生此错误的原因是AccessToken 生命周期被设定为60 分钟,一旦 accesstoken 过期,当我们尝试请求授权的 API 端点时,我们可以看到 X-Frames-Options 拒绝。

此外,如果您的应用程序无法在 iframe 中加载,MSAL 将无法静默获取令牌。

一种可能的解决方案是创建一个专用页面作为您的重定向 uri 进行静默操作,例如

设置 X-frame-options 的值为 SAMEORIGIN

<customHeaders>  
<add name="X-Frame-Options" value="SAMEORIGIN" />  
</customHeaders>

参考: Refused to display https://login.microsoftonline.com/common/oauth2/ in a frame because it set 'X-Frame-Options' to 'deny'. · Issue #494 · AzureAD/microsoft-authentication-library-for-js (github.com)

【讨论】:

    猜你喜欢
    • 2017-07-29
    • 1970-01-01
    • 1970-01-01
    • 2016-11-11
    • 1970-01-01
    • 2017-07-25
    • 1970-01-01
    • 2013-04-20
    • 2016-08-15
    相关资源
    最近更新 更多