【问题标题】:How to get Facebook "age_range" and "gender" using Azure AD B2C如何使用 Azure AD B2C 获取 Facebook“age_range”和“gender”
【发布时间】:2018-07-25 16:51:48
【问题描述】:

我目前正在使用内置属性。
我想从 FB 获取“age_range”和“gender”。
我是否需要按照以下主题中的说明处理自定义策略:

如何使用 Azure AD B2C 获取 Facebook 个人资料图片 how to get Facebook profile picture using Azure AD B2C
得到它们?

谢谢!

【问题讨论】:

    标签: azure-ad-b2c


    【解决方案1】:

    是的,您必须为此创建一个自定义策略,然后:

    1:在扩展文件中声明“ageRange”和“gender”声明类型。

    2:将“age_range”和“gender”字段添加到“ClaimsEndpoint”元数据项,并将“ageRange”和“gender”输出声明添加到“Facebook-OAUTH”技术配置文件。

    3:在信赖方文件中发出“ageRange”和“gender”声明。

    如果要将 Facebook 中的“age_range”和“gender”字段作为属性保存到 Azure AD B2C,则必须:

    1:按照Azure Active Directory B2C: Creating and using custom attributes in a custom profile edit policy 的步骤为“AgeRange”和“Gender”创建自定义属性。

    2:将声明类型声明以及对它们的所有其他引用从“ageRange”和“gender”更改为“extension_AgeRange”和“extension_Gender”。

    3:将扩展文件中的“extension_AgeRange”和“extension_Gender”声明添加到“AAD-UserWriteUsingAlternativeSecurityId”和“AAD-UserReadUsingAlternativeSecurityId”技术配置文件中:

    <ClaimsProvider>
      <DisplayName>Facebook</DisplayName>
      <TechnicalProfiles>
        <TechnicalProfile Id="AAD-UserReadUsingAlternativeSecurityId">
          <OutputClaims>
            <OutputClaim ClaimTypeReferenceId="extension_AgeRange" />
            <OutputClaim ClaimTypeReferenceId="extension_Gender" />
          </OutputClaims>
        </TechnicalProfile>
        <TechnicalProfile Id="AAD-UserWriteUsingAlternativeSecurityId">
          <PersistedClaims>
            <PersistedClaim ClaimTypeReferenceId="extension_AgeRange" />
            <PersistedClaim ClaimTypeReferenceId="extension_Gender" />
          </PersistedClaims>
        </TechnicalProfile>
      </TechnicalProfiles>
    </ClaimsProvider>
    

    【讨论】:

    • 感谢您的确认!我很惊讶它们不是内置属性的一部分
    • 没问题@NikolaiT。它们不是内置属性,因为默认情况下,它们不是 Azure AD 目录中用户对象的标准属性。如果以上答案对您有帮助,请您标记一下吗?
    猜你喜欢
    • 2018-06-10
    • 1970-01-01
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多