继续Azure B2C用户在身份验证失败时的旅程 [英] Continue Azure B2C user journey on authentication failure

查看:12
本文介绍了继续Azure B2C用户在身份验证失败时的旅程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Azure B2C身份体验框架创建自定义用户旅程。我的问题是,当身份验证失败时,我想继续用户旅程。但是,身份验证失败似乎被解释为异常,从而导致旅程终止。

此旅程旨在适应从传统身份提供商到B2C的即时帐户迁移流程。

我要完成的流程是:

  1. 尝试使用B2C登录表单进行身份验证
  2. 鉴权失败时,查询REST API以确定旧系统中是否存在该用户的电子邮件地址
  3. 如果存在电子邮件地址,则向用户提供B2C注册表

这种情况可能吗?

推荐答案

我不确定是否有办法在完全身份验证失败后继续,但如果只检查用户帐户是否存在就足够了,您可能不需要这样做。

无需尝试身份验证即可查看输入的用户名在B2C中是否存在。如果目录中不存在用户,则将RaiseErrorIfClaimsEpidalDoesNotExist元数据设置为False将允许B2C策略继续。然后,您可以使用输入的用户名并继续使用其他技术配置文件。

我将以下代码片段用作验证技术配置文件,如果找到对象ID,则运行登录-非交互配置文件,如果未找到,则运行自定义身份验证配置文件

   <TechnicalProfile Id="AAD-UserReadUsingEmailAddress-NoError">
  <Metadata>
    <Item Key="Operation">Read</Item>
    <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">false</Item>
  </Metadata>
  <IncludeInSso>false</IncludeInSso>
  <InputClaims>
    <InputClaim ClaimTypeReferenceId="signInName" PartnerClaimType="signInNames.emailAddress" />
  </InputClaims>
  <OutputClaims>
    <!-- Required claims -->
    <OutputClaim ClaimTypeReferenceId="objectId" />
    <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="localAccountAuthentication" />
    <OutputClaim ClaimTypeReferenceId="extension_isMigrated" DefaultValue="False" />
    <OutputClaim ClaimTypeReferenceId="strongAuthenticationPhoneNumber" />
    <!-- Optional claims -->
    <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
    <OutputClaim ClaimTypeReferenceId="displayName" />
    <OutputClaim ClaimTypeReferenceId="accountEnabled" />
    <OutputClaim ClaimTypeReferenceId="otherMails" />
    <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
    <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
  </OutputClaims>
  <IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>

这篇关于继续Azure B2C用户在身份验证失败时的旅程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆