簡體   English   中英

Azure B2C:在聯合身份提供程序上注銷期間阻止 iframe 的問題

[英]Azure B2C: Issues with blocked iframe during signout on Federated Identity Provider

我們在使用 Azure B2C 和自定義策略完成注銷流程時遇到問題。

我們在 Azure AD 中創建了一個示例企業應用程序,並將其設置為我們在 B2C 環境中的自定義策略中的聯合身份提供者,除了注銷問題外,一切都按預期工作。

退出流程。

  1. 第一步運行良好,會話在 B2C 身份提供者上被清除。
  2. 我們可以在網絡選項卡中看到在聯合身份提供者上調用了正確的端點,但是這個請求被阻止了(net::ERR_BLOCKED_BY_RESPONSE)然后我檢查了響應頭並找到了X-Frame-Options: DENY 我不確定,但對我來說,請求似乎是從 iframe 發出的,但被阻止了。
  3. 用戶被重定向回應用程序的 post_logout_redirect_url

解決方法是將 end_session_endpoint 作為 post_logout_redirect_url:

https://domain.b2clogin.com/domain.onmicrosoft.com/signin/oauth2/v2.0/logout?post_logout_redirect_uri=https://login.microsoftonline.com/guid/oauth2/v2.0/logout?post_logout_redirect_url=https://app.com/callback.html

這工作正常。

這是技術簡介


<TechnicalProfile Id="Company-OpenIdConnect">
   <DisplayName>Company</DisplayName>
   <Description>Company</Description>
   <Protocol Name="OpenIdConnect"/>
   <Metadata>
      <Item Key="METADATA">https://login.microsoftonline.com/tenantID/v2.0/.well-known/openid-configuration</Item>
      <Item Key="client_id">guid</Item>
      <Item Key="response_types">code</Item>
      <Item Key="scope">openid profile</Item>
      <Item Key="response_mode">form_post</Item>
      <Item Key="HttpBinding">POST</Item>
      <Item Key="UsePolicyInRedirectUri">false</Item>
    </Metadata>
    ...
    <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin"/>
</TechnicalProfile>

這是意料之中的,大多數 IdP 不允許在 iframe 中呈現以進行登錄或注銷。 Azure AD 也不允許在 iframe 中呈現,因此注銷不會完成。

您的解決方法會導致整頁重定向,這將起作用,但用戶體驗可能會令人不快。

https://docs.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-custom-policy#sign-out

注銷會清除用戶使用 Azure AD B2C 的單一登錄狀態,但它可能不會將用戶從其社交身份提供程序會話中注銷。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM