Azure B2C - 重命名输出声明
Azure B2C - Renaming an output claim
我正在使用 Azure B2C(Azure AD 作为我的身份提供者)。我正在使用自定义政策,我有一个要实现的简单目标,我正在尝试重命名声明。这是我的示例,取自 Azure B2C 入门包 https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/LocalAccounts
我正在从 Azure B2C 请求我的姓氏,它 return 在声明“http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname”中,我的目标是更改姓名这个从“http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname”到“lastname”的声明,我注意到 TrustFrameworkBase.xml 中存在以下定义:
<ClaimType Id="surname">
<DisplayName>Surname</DisplayName>
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="family_name" />
<Protocol Name="OpenIdConnect" PartnerClaimType="family_name" />
<Protocol Name="SAML2" PartnerClaimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" />
</DefaultPartnerClaimTypes>
</ClaimType>
我只是不确定如何将它变成 return 另一个名称,因为那是 PartnerClaimType 并且需要准确。
您可以在叶策略之一的依赖方技术配置文件中重命名。在输出声明元素中使用 PartenrClaimtype 属性。
定义一个以姓氏命名的声明
<ClaimType Id="lastname">
<DisplayName>LastName</DisplayName>
<DataType>string</DataType>
</ClaimType>
然后在依赖方部分
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUpOrSignIn" />
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="lastname" />
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
我正在使用 Azure B2C(Azure AD 作为我的身份提供者)。我正在使用自定义政策,我有一个要实现的简单目标,我正在尝试重命名声明。这是我的示例,取自 Azure B2C 入门包 https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/tree/master/LocalAccounts
我正在从 Azure B2C 请求我的姓氏,它 return 在声明“http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname”中,我的目标是更改姓名这个从“http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname”到“lastname”的声明,我注意到 TrustFrameworkBase.xml 中存在以下定义:
<ClaimType Id="surname">
<DisplayName>Surname</DisplayName>
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OAuth2" PartnerClaimType="family_name" />
<Protocol Name="OpenIdConnect" PartnerClaimType="family_name" />
<Protocol Name="SAML2" PartnerClaimType="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname" />
</DefaultPartnerClaimTypes>
</ClaimType>
我只是不确定如何将它变成 return 另一个名称,因为那是 PartnerClaimType 并且需要准确。
您可以在叶策略之一的依赖方技术配置文件中重命名。在输出声明元素中使用 PartenrClaimtype 属性。
定义一个以姓氏命名的声明
<ClaimType Id="lastname">
<DisplayName>LastName</DisplayName>
<DataType>string</DataType>
</ClaimType>
然后在依赖方部分
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUpOrSignIn" />
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="surname" PartnerClaimType="lastname" />
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>