使用扩展属性或不常见的标准属性在 AAD B2C 中查找用户

问题描述 投票:0回答:1

这是这个问题的后续。我需要查询 Azure AD B2C 以使用员工 ID 查找用户,由于与我们的帐户配置解决方案可以处理的字段相关的原因,该员工 ID 当前存储在电话号码字段中。

我创建了一个 Azure Active Directory TechnicalProfile,它将电话号码指定为 InputClaim:

 <TechnicalProfile Id="AAD-UserReadUsingEmployeeId">
      <Metadata>
        <Item Key="Operation">Read</Item>
        <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
        <Item Key="UserMessageIfClaimsPrincipalDoesNotExist">An account could not be found for the provided ID.</Item>
      </Metadata>
      <IncludeInSso>false</IncludeInSso>
      <InputClaims>
        <InputClaim ClaimTypeReferenceId="telephoneNumber" PartnerClaimType="employeeId" Required="true" />
      </InputClaims>
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="objectId" />
        <OutputClaim ClaimTypeReferenceId="userPrincipalName" />
        <OutputClaim ClaimTypeReferenceId="otherMails" />
        <OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" />
        <OutputClaim ClaimTypeReferenceId="signInNames.phoneNumber" />
        <OutputClaim ClaimTypeReferenceId="displayName" />
        <OutputClaim ClaimTypeReferenceId="givenName" />
        <OutputClaim ClaimTypeReferenceId="surname" />
        <OutputClaim ClaimTypeReferenceId="telephoneNumber" />
      </OutputClaims>
      <IncludeTechnicalProfile ReferenceId="AAD-Common" />
    </TechnicalProfile>

但是,在编译此策略时,我收到错误:

Azure Active Directory 提供程序技术配置文件“AAD-UserReadUsingEmployeeId”不支持输入声明“telephoneNumber”

我从文档here了解到,telephoneNumber 只能用作 persistenceClaim 或 OutputClaim...所以我想我可能会遇到这个限制。我以为我可以通过使用扩展属性查询 Azure AD B2C 来摆脱这个问题,但我感到很困惑:

  • 我之前链接到的问题的答案指出,您无法通过某些随机属性查询 Azure AD B2C,因为该属性需要是唯一的
  • FIDO2 示例策略此处 确实 使用扩展属性来查询 Azure AD B2C 并查找用户,因此在某些情况下似乎是可能的。

那么,我的理解是否正确

  • 可以使用任何扩展属性在 Azure AD B2C 中查找用户,并且您有责任确保属性值是唯一的
  • 不能使用大多数标准属性(例如电话号码)来查找用户

或者在我配置技术配置文件的方式中是否有一些明显的我忽略的事情?

azure-active-directory azure-ad-b2c azure-ad-b2c-custom-policy
1个回答
1
投票

这些是正确的:

  • 您可以使用任何扩展属性在 AAD B2C 中查找用户,并且 您需要确保属性值是唯一的
  • 您无法使用大多数标准属性(例如电话号码)来查找用户
© www.soinside.com 2019 - 2024. All rights reserved.