你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用 Bluink eID-Me 配置 Azure Active Directory B2C 进行身份验证

重要

自 2025 年 5 月 1 日起,Azure AD B2C 将不再可供新客户购买。 在我们的常见问题解答中了解详细信息

在您开始之前

Azure Active Directory B2C (Azure AD B2C) 有两种方法来定义用户与应用程序的交互:预定义的用户流或可配置的自定义策略。 自定义策略适用于复杂的场景。 在大多数情况下,我们建议使用用户流。 请参阅用户 流和自定义策略概述

将 Azure AD B2C 身份验证与 eID-Me 集成

了解如何将 Azure AD B2C 身份验证与 Bluink eID-Me 集成,后者是面向加拿大公民的身份验证和分散式数字身份解决方案。 使用 eID-Me,Azure AD B2C 租户可以验证用户身份,获取经过验证的注册和登录身份声明。 集成支持多因素身份验证和具有安全数字身份的无密码登录。 组织可以满足身份保证级别 (IAL) 2 和了解您的客户 (KYC) 要求。

要了解更多信息,请访问 bluink.ca: Bluink Ltd

先决条件

若要开始,需要:

另请参阅 教程:在 Azure AD B2C 中创建用户流和自定义策略

方案说明

eID-Me 作为 OpenID Connect (OIDC) 标识提供者与 Azure AD B2C 集成。 以下组件构成了 Azure AD B2C 的 eID-Me 解决方案:

  • Azure AD B2C 租户 - 配置为 eID-Me 中的信赖方,使 eID-Me 能够信任 Azure AD B2C 租户进行注册和登录
  • Azure AD B2C 租户应用程序 - 假设租户需要 Azure AD B2C 租户应用程序
    • 应用程序在事务期间接收 Azure AD B2C 收到的标识声明
  • eID-Me 智能手机应用 - Azure AD B2C 租户用户需要适用于 iOS 或 Android 的应用
  • 颁发的 eID-Me 数字身份 - 来自 eID-Me 身份验证
    • 用户将获得应用程序中数字钱包的数字身份。 需要有效的身份证明文件。

eID-Me 应用程序在交易期间对用户进行身份验证。 X509 公钥身份验证使用 eID-Me 数字身份中的私有签名密钥提供无密码 MFA。

下图说明了 eID-Me 身份验证证明,它发生在 Azure AD B2C 流之外。

eID-Me 中的身份验证流程图。

  1. 用户将自拍上传到 eID-Me 智能手机应用程序。
  2. 用户扫描政府颁发的身份证明文件(例如护照或驾驶执照)并将其上传到 eID-Me 智能手机应用程序。
  3. eID-Me 将数据提交到 Identity Service 进行验证。
  4. 向用户颁发一个数字身份,该身份保存在应用程序中。

下图说明了 Azure AD B2C 与 eID-Me 的集成。

Azure AD B2C 与 eID-Me 的集成图。

  1. 用户打开 Azure AD B2C 登录页,然后使用用户名登录或注册。
  2. 用户转发到 Azure AD B2C 登录和注册策略。
  3. Azure AD B2C 使用 OIDC 授权代码流将用户重定向到 eID-Me 标识路由器。
  4. 路由器向用户移动应用程序发送推送通知,其中包含身份验证和授权请求详细信息。
  5. 此时将显示用户身份验证质询,然后显示身份声明提示。
  6. 质询响应将发送到路由器。
  7. 路由器使用身份验证结果回复 Azure AD B2C。
  8. Azure AD B2C ID 令牌响应将发送到应用程序。
  9. 授予或拒绝用户访问权限。

开始使用 eID-Me

转到 bluink.ca 联系我们 页面,请求演示,目标是配置测试或生产环境,以将 Azure AD B2C 租户设置为信赖方。 租户确定注册 eID-Me 的消费者所需的身份声明。

在 eID-Me 中配置应用程序

要将租户应用程序配置为 eID-Me 中的 eID-ME 依赖方,请提供以下信息:

资产 DESCRIPTION
名称 Azure AD B2C 或其他应用程序名称
域名 name.onmicrosoft.com
重定向 URI https://jwt.ms
重定向 URL https://your-B2C-tenant-name.b2clogin.com/your-B2C-tenant-name.onmicrosoft.com/oauth2/authresp
例如:https://fabrikam.b2clogin.com/fabrikam.onmicrosoft.com/oauth2/authresp
对于自定义域,请输入 https://your-domain-name/your-tenant-name.onmicrosoft.com/oauth2/authresp.
应用程序主页 URL 向最终用户显示
应用程序隐私策略 URL 向最终用户显示

注释

配置信赖方后,ID-Me 会提供客户端 ID 和客户端密钥。 记下客户端 ID 和客户端密码,以在 Azure AD B2C 中配置标识提供者 (IdP)。

在 Azure AD B2C 中添加新的标识提供者

请使用包含 Azure AD B2C 租户的目录进行以下操作。

  1. 至少以 Azure AD B2C 租户的 B2C IEF 策略管理员身份登录到 Azure 门户
  2. 在顶部菜单中,选择 “目录 + 订阅”。
  3. 选择包含租户的目录。
  4. 在 Azure 门户的左上角,选择 “所有服务”。
  5. 搜索并选择“Azure AD B2C”。
  6. 导航到“仪表板”“Azure Active Directory B2C”>“标识提供者”。>
  7. 选择 「新建 OpenID Connect 提供程序」
  8. 选择 并添加

配置标识提供者

配置标识提供者:

  1. 选择 标识提供者类型>OpenID Connect
  2. 在身份提供商表单中,对于 Name (名称),输入 eID-Me Passwordless 或其他名称。
  3. 对于 Client ID (客户端 ID),输入 eID-Me 中的客户端 ID。
  4. 对于 Client Secret (客户端密钥),输入 eID-Me 中的 Client Secret (客户端密钥)。
  5. 对于 Scope(范围),选择 openid email profile(openid 电子邮件配置文件)。
  6. 对于 Response type (响应类型),选择 code (代码)。
  7. 对于 Response mode (响应模式),选择 form post (表单帖子)。
  8. 选择“确定”
  9. 选择“映射此标识提供者的声明”
  10. 对于 用户 ID,请使用
  11. 对于 Display name (显示名称),请使用 name (名称)。
  12. 对于 给定名称,请使用 given_name
  13. 对于 姓氏,请使用 family_name
  14. 对于 电子邮件,请使用 电子邮件
  15. 选择“保存”

配置多重身份验证

eID-Me 是多重身份验证器,因此不需要用户流多重身份验证配置。

创建用户流策略

对于以下说明,eID-Me 在 B2C 身份提供商中显示为新的 OIDC 身份提供商。

  1. 在 Azure AD B2C 租户的 “策略”下,选择 “用户流”。
  2. 选择“新建用户流”。
  3. 选择“注册和登录”“版本”>“创建”>
  4. 输入策略 名称
  5. Identity providers(身份提供商)中,选择创建的 eID-Me 身份提供商。
  6. 对于 “本地帐户”,请选择“ ”。 该选择将禁用电子邮件和密码身份验证。
  7. 选择运行用户流
  8. 输入 Replying URL(回复 URL),例如 https://jwt.ms.
  9. 浏览器将重定向到 eID-Me 登录页面。
  10. 输入用户注册中的帐户名称。
  11. 用户在移动设备上接收带有 eID-Me 的推送通知。
  12. 此时将显示身份验证质询。
  13. 质询被接受,浏览器重定向到回复 URL。

注释

Azure Active Directory B2C (Azure AD B2C) 有两种方法来定义用户与应用程序的交互:预定义的用户流或可配置的自定义策略。 自定义策略适用于复杂的场景。 在大多数情况下,我们建议使用用户流。 请参阅用户 流和自定义策略概述

创建策略密钥

将记录在 Azure AD B2C 租户中的客户端密码存储起来。 请使用包含 Azure AD B2C 租户的目录进行以下操作。

  1. 登录到 Azure 门户
  2. 在门户工具栏中,选择 “目录 + 订阅”。
  3. 门户设置的目录 + 订阅 页上的 目录名称 列表中,找到您的 Azure AD B2C 目录。
  4. 选择“ 切换”。
  5. 在 Azure 门户的左上角,选择 “所有服务”。
  6. 搜索并选择“Azure AD B2C”。
  7. 在“概述”页上选择“标识体验框架”。
  8. 选择 策略密钥
  9. 选择 并添加
  10. 对于“选项”,选择“手动”
  11. 输入策略密钥的名称。 例如,eIDMeClientSecretB2C_1A_前缀将添加到密钥名称。
  12. 机密中,输入所记录的客户端密码。
  13. 对于“密钥用法”,请选择“签名”
  14. 选择 创建

将 eID-Me 配置为身份提供程序

将 eID-Me 定义为声明提供程序,以使用户能够使用 eID-Me 登录。 Azure AD B2C 通过终结点与它通信。 该终结点提供 Azure AD B2C 使用的声明,用于验证使用其设备上的数字 ID 进行用户身份验证。

若要将 eID-Me 定义为声明提供程序,请将其添加到策略扩展插件文件中的 ClaimsProvider 元素中。

  1. 打开 TrustFrameworkExtensions.xml

  2. 找到 ClaimsProviders 元素。 如果未显示,请在根元素下添加它。

  3. 添加新的 ClaimsProvider

       <ClaimsProvider>
       <Domain>eID-Me</Domain>
       <DisplayName>eID-Me</DisplayName>
       <TechnicalProfiles>
         <TechnicalProfile Id="eID-Me-OIDC">
           <!-- The text in the following DisplayName element is shown to the user on the claims provider 
    selection screen. -->
           <DisplayName>eID-Me for Sign In</DisplayName>
           <Protocol Name="OpenIdConnect" />
           <Metadata>
             <Item Key="ProviderName">https://eid-me.bluink.ca</Item>
             <Item Key="METADATA">https://demoeid.bluink.ca/.well-known/openid-configuration</Item>
             <Item Key="response_types">code</Item>
             <Item Key="scope">openid email profile</Item>
             <Item Key="response_mode">form_post</Item>
             <Item Key="HttpBinding">POST</Item>
             <Item Key="token_endpoint_auth_method">client_secret_post</Item>
             <Item Key="client_id">eid_me_rp_client_id</Item>
             <Item Key="UsePolicyInRedirectUri">false</Item>
           </Metadata>
           <CryptographicKeys>
             <Key Id="client_secret" StorageReferenceId="B2C_1A_eIDMeClientSecret" />
           </CryptographicKeys>
           <InputClaims />
           <OutputClaims>
             <OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub" />
             <OutputClaim ClaimTypeReferenceId="tenantId" PartnerClaimType="tid" />
             <OutputClaim ClaimTypeReferenceId="givenName" PartnerClaimType="given_name" />
             <OutputClaim ClaimTypeReferenceId="surName" PartnerClaimType="family_name" />
             <OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name" />
             <OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email" />
             <OutputClaim ClaimTypeReferenceId="IAL" PartnerClaimType="identity_assurance_level_achieved" DefaultValue="unknown IAL" />
             <OutputClaim ClaimTypeReferenceId="authenticationSource" DefaultValue="socialIdpAuthentication" AlwaysUseDefaultValue="true" />
             <OutputClaim ClaimTypeReferenceId="identityProvider" PartnerClaimType="iss" />
             <OutputClaim ClaimTypeReferenceId="locality" PartnerClaimType="locality" DefaultValue="unknown locality" />
             <OutputClaim ClaimTypeReferenceId="region" PartnerClaimType="region" DefaultValue="unknown region" />
           </OutputClaims>
           <OutputClaimsTransformations>
             <OutputClaimsTransformation ReferenceId="CreateRandomUPNUserName" />
             <OutputClaimsTransformation ReferenceId="CreateUserPrincipalName" />
             <OutputClaimsTransformation ReferenceId="CreateAlternativeSecurityId" />
             <OutputClaimsTransformation ReferenceId="CreateSubjectClaimFromAlternativeSecurityId" />
           </OutputClaimsTransformations>
           <UseTechnicalProfileForSessionManagement ReferenceId="SM-SocialLogin" />
         </TechnicalProfile>
       </TechnicalProfiles>
     </ClaimsProvider>
    
  4. 对于 eid_me_rp_client_id 请输入 eID-Me relying-party Client ID。

  5. 选择“保存”

支持的身份声明

您可以添加更多 eID-Me 支持的身份声明。

  1. 打开 TrustFrameworksExtension.xml
  2. 查找BuildingBlocks元素。

注释

OID 存储库 上查找受支持的 eID-Me 身份声明列表 ,并在 well-known/openid-configuration 上查找 OIDC 标识符。

<BuildingBlocks>
<ClaimsSchema>
 <ClaimType Id="IAL">
     <DisplayName>Identity Assurance Level</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="identity_assurance_level_achieved" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The Identity Assurance Level Achieved during proofing of the digital identity.</AdminHelpText>
     <UserHelpText>The Identity Assurance Level Achieved during proofing of the digital identity.</UserHelpText>
     <UserInputType>Readonly</UserInputType>
   </ClaimType>

<ClaimType Id="picture">
     <DisplayName>Portrait Photo</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="thumbnail_portrait" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The portrait photo of the user.</AdminHelpText>
     <UserHelpText>Your portrait photo.</UserHelpText>
     <UserInputType>Readonly</UserInputType>
   </ClaimType>

 <ClaimType Id="middle_name">
     <DisplayName>Portrait Photo</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="middle_name" />
     </DefaultPartnerClaimTypes>
     <UserHelpText>Your middle name.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

<ClaimType Id="birthdate">
     <DisplayName>Date of Birth</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="birthdate" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's date of birth.</AdminHelpText>
     <UserHelpText>Your date of birth.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

 <ClaimType Id="gender">
     <DisplayName>Gender</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="gender" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's gender.</AdminHelpText>
     <UserHelpText>Your gender.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>
 
 <ClaimType Id="street_address">
     <DisplayName>Locality/City</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="street_address" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's full street address, which MAY include house number, street name, post office box.</AdminHelpText>
     <UserHelpText>Your street address of residence.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

<ClaimType Id="locality">
     <DisplayName>Locality/City</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="locality" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's current city or locality of residence.</AdminHelpText>
     <UserHelpText>Your current city or locality of residence.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

   <ClaimType Id="region">
     <DisplayName>Province or Territory</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="region" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's current province or territory of residence.</AdminHelpText>
     <UserHelpText>Your current province or territory of residence.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

   <ClaimType Id="country">
     <DisplayName>Country</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="country" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's current country of residence.</AdminHelpText>
     <UserHelpText>Your current country of residence.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

   <ClaimType Id="dl_number">
     <DisplayName>Driver's Licence Number</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="dl_number" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's driver's licence number.</AdminHelpText>
     <UserHelpText>Your driver's licence number.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>

   <ClaimType Id="dl_class">
     <DisplayName>Driver's Licence Class</DisplayName>
     <DataType>string</DataType>
     <DefaultPartnerClaimTypes>
       <Protocol Name="OpenIdConnect" PartnerClaimType="dl_class" />
     </DefaultPartnerClaimTypes>
     <AdminHelpText>The user's driver's licence class.</AdminHelpText>
     <UserHelpText>Your driver's licence class.</UserHelpText>
     <UserInputType>TextBox</UserInputType>
   </ClaimType>
 </ClaimsSchema>

添加用户旅程

对于以下说明,身份提供商已设置,但未在任何登录页面中设置。 如果没有自定义用户旅程,请复制模板用户旅程。

  1. 从入门包中打开 TrustFrameworkBase.xml 文件。
  2. 找到并复制包含 ID=SignUpOrSignIn 元素的内容。
  3. 打开 TrustFrameworkExtensions.xml
  4. 找到 UserJourneys 元素。 如果未显示该元素,请添加一个。
  5. UserJourney 元素的内容粘贴为 UserJourneys 元素的子元素。
  6. 重命名用户历程 ID,例如 ID=CustomSignUpSignIn

将标识提供者添加到用户旅程

将新的标识提供者添加到用户旅程。

  1. 在用户旅程中,找到包含 Type=CombinedSignInAndSignUp 或 Type=ClaimsProviderSelection 的业务流程步骤元素。 通常这是第一个编排步骤。 ClaimsProviderSelections 元素包含用户登录时使用的身份提供者列表。 元素的顺序控制用户看到的登录按钮的顺序。
  2. 添加ClaimsProviderSelection XML 元素。
  3. TargetClaimsExchangeId 值设置为友好名称。
  4. 在下一个编排步骤中,添加 ClaimsExchange 元素。
  5. Id 设置为目标索赔交换 ID 值。
  6. 将 vTechnicalProfileReferenceId 值更新为你创建的技术配置文件 ID。

以下 XML 演示了使用身份提供商的七个用户旅程编排步骤:

 <UserJourney Id="eIDME-SignUpOrSignIn">
   <OrchestrationSteps>
     <OrchestrationStep Order="1" Type="CombinedSignInAndSignUp" ContentDefinitionReferenceId="api.signuporsignin">
       <ClaimsProviderSelections>
         <ClaimsProviderSelection TargetClaimsExchangeId="eIDMeExchange" />
        </ClaimsProviderSelections>
   </OrchestrationStep>
     <!-- Check if the user has selected to sign in using one of the social providers -->
     <OrchestrationStep Order="2" Type="ClaimsExchange">
       <Preconditions>
         <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
           <Value>objectId</Value>
           <Action>SkipThisOrchestrationStep</Action>
         </Precondition>
       </Preconditions>
       <ClaimsExchanges>
         <ClaimsExchange Id="eIDMeExchange" TechnicalProfileReferenceId="eID-Me-OIDC" />
       </ClaimsExchanges>
     </OrchestrationStep>
     <!-- For social IDP authentication, attempt to find the user account in the directory. -->
     <OrchestrationStep Order="3" Type="ClaimsExchange">
       <Preconditions>
         <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
           <Value>authenticationSource</Value>
           <Value>localAccountAuthentication</Value>
           <Action>SkipThisOrchestrationStep</Action>
         </Precondition>
       </Preconditions>
       <ClaimsExchanges>
         <ClaimsExchange Id="AADUserReadUsingAlternativeSecurityId" TechnicalProfileReferenceId="AAD-UserReadUsingAlternativeSecurityId-NoError" />
       </ClaimsExchanges>
     </OrchestrationStep>
     <!-- Show self-asserted page only if the directory does not have the user account already (i.e. we do not have an objectId).  -->
     <OrchestrationStep Order="4" Type="ClaimsExchange">
       <Preconditions>
         <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
           <Value>objectId</Value>
           <Action>SkipThisOrchestrationStep</Action>
         </Precondition>
       </Preconditions>
       <ClaimsExchanges>
         <ClaimsExchange Id="SelfAsserted-Social" TechnicalProfileReferenceId="SelfAsserted-Social" />
       </ClaimsExchanges>
     </OrchestrationStep>
     <!-- This step reads any user attributes that we may not have received when authenticating using ESTS so they can be sent in the token. -->
     <OrchestrationStep Order="5" Type="ClaimsExchange">
       <Preconditions>
         <Precondition Type="ClaimEquals" ExecuteActionsIf="true">
           <Value>authenticationSource</Value>
           <Value>socialIdpAuthentication</Value>
           <Action>SkipThisOrchestrationStep</Action>
         </Precondition>
       </Preconditions>
       <ClaimsExchanges>
         <ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
       </ClaimsExchanges>
     </OrchestrationStep>
     <!-- The previous step (SelfAsserted-Social) could have been skipped if there were no attributes to collect 
          from the user. So, in that case, create the user in the directory if one does not already exist 
          (verified using objectId which would be set from the last step if account was created in the directory. -->
     <OrchestrationStep Order="6" Type="ClaimsExchange">
       <Preconditions>
         <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
           <Value>objectId</Value>
           <Action>SkipThisOrchestrationStep</Action>
         </Precondition>
       </Preconditions>
       <ClaimsExchanges>
         <ClaimsExchange Id="AADUserWrite" TechnicalProfileReferenceId="AAD-UserWriteUsingAlternativeSecurityId" />
       </ClaimsExchanges>
     </OrchestrationStep>
     <OrchestrationStep Order="7" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
   </OrchestrationSteps>
   <ClientDefinition ReferenceId="DefaultWeb" />
 </UserJourney>

配置信赖方策略

信赖方策略指定 Azure AD B2C 执行的用户旅程。 您可以控制传递给应用程序的声明。 调整 eID-Me-OIDC-Signup TechnicalProfile 元素的 OutputClaims 元素。 在以下示例中,应用程序接收用户邮政编码、地区、区域、IAL、肖像、中间名和出生日期。 它接收布尔值 signupConditionsSatisfied 声明,该声明指示是否已创建帐户。

 <RelyingParty>
     <DefaultUserJourney ReferenceId="eIDMe-SignUpOrSignIn" />
     <TechnicalProfile Id="PolicyProfile">
       <DisplayName>PolicyProfile</DisplayName>
       <Protocol Name="OpenIdConnect" />
       <OutputClaims>
         <OutputClaim ClaimTypeReferenceId="displayName" />
         <OutputClaim ClaimTypeReferenceId="givenName" />
         <OutputClaim ClaimTypeReferenceId="surname" />
         <OutputClaim ClaimTypeReferenceId="email" />
         <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
         <OutputClaim ClaimTypeReferenceId="identityProvider" />
         <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
         <OutputClaim ClaimTypeReferenceId="postalCode" PartnerClaimType="postal_code" DefaultValue="unknown postal_code" />
         <OutputClaim ClaimTypeReferenceId="locality" PartnerClaimType="locality" DefaultValue="unknown locality" />
         <OutputClaim ClaimTypeReferenceId="region" PartnerClaimType="region" DefaultValue="unknown region" />
         <OutputClaim ClaimTypeReferenceId="IAL" PartnerClaimType="identity_assurance_level_achieved" DefaultValue="unknown IAL" />
         <OutputClaim ClaimTypeReferenceId="picture" PartnerClaimType="thumbnail_portrait" DefaultValue="unknown portrait" />
         <OutputClaim ClaimTypeReferenceId="middle_name" PartnerClaimType="middle_name" DefaultValue="unknown middle name" />
         <OutputClaim ClaimTypeReferenceId="birthdate" PartnerClaimType="birthdate" DefaultValue="unknown DOB" />
         <OutputClaim ClaimTypeReferenceId="newUser" PartnerClaimType="signupConditionsSatisfied" DefaultValue="false" />
       </OutputClaims>
       <SubjectNamingInfo ClaimType="sub" />
     </TechnicalProfile>
   </RelyingParty>

上传自定义策略

请使用包含 Azure AD B2C 租户的目录进行以下操作。

  1. 登录到 Azure 门户
  2. 在门户工具栏中,选择 “目录 + 订阅”。
  3. 门户设置“目录 + 订阅 ”页上的 “目录名称 ”列表中,找到 Azure AD B2C 目录。
  4. 选择“ 切换”。
  5. 在 Azure 门户中,搜索并选择 Azure AD B2C
  6. 在“策略”下,选择“Identity Experience Framework”
  7. 选择“ 上传自定义策略”。
  8. 按以下顺序上传更改的两个策略文件:
  • 扩展策略,例如 TrustFrameworkBase.xml
  • 例如,依赖方策略 SignUp.xml

测试自定义策略

  1. 选择信赖方策略,例如 B2C_1A_signup
  2. 对于 应用程序,请选择已注册的 Web 应用程序。
  3. 回复 URLhttps://jwt.ms.
  4. 选择“立即运行”。
  5. 注册策略调用 eID-Me。
  6. 对于 sign-in(登录),选择 eID-Me
  7. 浏览器重定向到 https://jwt.ms
  8. 将显示 Azure AD B2C 返回的令牌内容。

了解详细信息 :教程:在 Azure AD B2C 中注册 Web 应用程序

后续步骤