2017-03-07 56 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

相关问题