2017-03-07 50 views
2

在Azure AD B2C中,有「註冊/登錄」和「密碼重置」的單獨策略。我複製元數據終結了「登錄上/簽到」政策將Azure AD B2C與Azure移動應用程序一起使用時,密碼策略如何設置?

enter image description here

並將其粘貼到Azure的應用程序認證

enter image description here

這基本上工作,但有沒有地方放置密碼重置元數據,其中包含密碼重置模板。我認爲,因此,當您點擊「忘記密碼」時,您最終會以

您沒有權限查看此目錄或頁面。試圖去/xxx.onmicrosoft.com/B2C_1_b2c_sign_up_sign_in/api/CombinedSigninAndSignup/forgotPassword?csrf_token=xxx & p如果在

在〜/ .auth /登錄/ AAD /回調= B2C_1_b2c_sign_up_sign_in

爲什麼沒有登錄/註冊/密碼重置?

enter image description here

此外,另一個奇怪的是點擊創建一個新帳戶。

enter image description here

如果按取消,它再次進入回調需要許可頁面。

我下載的策略和密碼重置具有未在登錄

<UserJourneys> 
    <UserJourney Id="B2CPasswordResetV1"> 
     <OrchestrationSteps> 
     <OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.idpselections"> 
      <ClaimsProviderSelections> 
      <ClaimsProviderSelection TargetClaimsExchangeId="PasswordResetUsingEmailAddressExchange" /> 
      </ClaimsProviderSelections> 
     </OrchestrationStep> 
     </OrchestrationSteps> 
    </UserJourney> 
    </UserJourneys> 
    <RelyingParty> 
    <DefaultUserJourney ReferenceId="B2CPasswordResetV1" /> 
    <TechnicalProfile Id="PolicyProfile"> 
     <DisplayName>PolicyProfile</DisplayName> 
     <Protocol Name="OpenIdConnect" /> 
     <OutputClaims> 
     <OutputClaim ClaimTypeReferenceId="objectId" /> 
     <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" /> 
     <OutputClaim ClaimTypeReferenceId="emails" /> 
     <OutputClaim ClaimTypeReferenceId="displayName" /> 
     <OutputClaim ClaimTypeReferenceId="trustFrameworkPolicy" Required="true" DefaultValue="{policy}" /> 
     </OutputClaims> 
     <SubjectNamingInfo ClaimType="sub" /> 
    </TechnicalProfile> 
    </RelyingParty> 

更新以下。我剛剛發現這個

當你創建了註冊或登錄策略(本地帳戶),該 消費者會看到「忘記密碼?」鏈接在 體驗的第一頁。點擊此鏈接不會自動觸發 密碼重置策略。而是將特定的錯誤代碼AADB2C90118返回給您的應用程序 。您的應用程序需要處理此問題並調用 特定的密碼重置策略。演示這種將策略鏈接在一起的方法的示例在這裏。

看起來像它被張貼到回調。所以看起來zumo回調無法處理錯誤。如果zumo回調獲得狀態/代碼/ id_token,那麼它會完成。

enter image description here

回答

1

不幸的是,B2C的綜合應用服務支持不允許您的應用程序來處理錯誤回調重定向到您的重置密碼策略。你在這一點上的選項有:

  1. 使用自定義CSS或
  2. 配置在web.config中的自定義錯誤處理程序負責處理錯誤,並允許最終用戶調用您的密碼重置通過政策刪除重置密碼鏈接將它們重定向到/.auth/login/aad?p=B2C_1_B2CPasswordResetV1https://cgillum.tech/2016/08/10/app-service-auth-and-azure-ad-b2c-part-2/#comment-581

    這裏是我分享的Web.config片段展示瞭如何處理這個錯誤並重定向到一個靜態頁面在您的手機:

我在這篇博客評論中寫道的#2一個簡單的例子後端:

<configuration> 
    <system.webServer> 
    <httpErrors defaultResponseMode="File" errorMode="Custom" > 
     <clear /> 
     <error statusCode="401" subStatusCode="73" path="MyPage.html" /> 
    </httpErrors> 
    <system.webServer> 
</configuration> 

其它響應模式也是可用的,包括ExecuteURL重定向。其中之一可能比我使用文件的示例更合適,具體取決於您的需要。 IIS定製錯誤的更多細節可以在這裏找到:https://www.iis.net/configreference/system.webserver/httperrors#005

+0

謝謝克里斯,我正打算追捕你! :) - 集成的App Service是Azure內部的東西嗎?似乎這是非常重要的功能!如果您在嘗試創建新用戶後按「取消」,也會發生這種情況。 – tofutim

+0

我也嘗試過'''''' 無濟於事。也許有些東西被南希/ Zumo/SignalR攔截了 – tofutim

+1

我明白了。這是南希的錯。當我關閉南希時攔截工作就很好。 – tofutim

相關問題