Azure ad b2c 为什么在我的自定义策略中将声明标记为不受支持?
我正在将我们的应用程序从使用内置用户流切换到自定义策略,这样我们就可以启用一些我们需要的功能,如帐户链接和REST集成 我的TrustFrameworkBase.xml和TrustFrameworkExtensions.xml策略文件都可以正常上载。但当我尝试上载依赖方文件时,我遇到了一个无法解释的验证错误: 验证失败:在租户“hyperproof localdev.onmicrosoft.com”的策略“B2C_1A_注册”中发现2个验证错误。策略“B2C_1A_注册”的Azure Active Directory提供程序技术配置文件“AAD UserWriteUningAlternativeSecurityID”中不支持输入声明“AlternativeSecurityID”。策略“B2C_1A_注册”的Azure Active Directory提供程序技术配置文件“AAD UserCreateEmailsClaim”中不支持输入声明“电子邮件” 我遵循了在线指导,比如为这些主张添加支持。还无法确定B2C认为这些不受支持的原因 以下是我在TrustFrameworkBase.xml中对Azure ad b2c 为什么在我的自定义策略中将声明标记为不受支持?,azure-ad-b2c,Azure Ad B2c,我正在将我们的应用程序从使用内置用户流切换到自定义策略,这样我们就可以启用一些我们需要的功能,如帐户链接和REST集成 我的TrustFrameworkBase.xml和TrustFrameworkExtensions.xml策略文件都可以正常上载。但当我尝试上载依赖方文件时,我遇到了一个无法解释的验证错误: 验证失败:在租户“hyperproof localdev.onmicrosoft.com”的策略“B2C_1A_注册”中发现2个验证错误。策略“B2C_1A_注册”的Azure Activ
电子邮件的内容:
<ClaimType Id="emails">
<DisplayName>Emails</DisplayName>
<DataType>stringCollection</DataType>
<UserHelpText>User's email addresses</UserHelpText>
</ClaimType>
电子邮件
stringCollection
用户的电子邮件地址
阅读
真的
假的
这是依赖方文件:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="hyperprooflocaldev.onmicrosoft.com"
PolicyId="B2C_1A_SignUp"
PublicPolicyUri="http://hyperprooflocaldev.onmicrosoft.com/B2C_1A_SignUp"
DeploymentMode="Development"
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"
>
<BasePolicy>
<TenantId>hyperprooflocaldev.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUp" />
<UserJourneyBehaviors>
<SessionExpiryType>Rolling</SessionExpiryType>
<SessionExpiryInSeconds>86400</SessionExpiryInSeconds>
<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="451d3a92-fb38-4a1b-9b77-2f6572677090" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
<ContentDefinitionParameters>
<Parameter Name="emailAddress">{OIDC:LoginHint}</Parameter>
<Parameter Name="givenName">{OAUTH-KV:givenName}</Parameter>
<Parameter Name="surname">{OAUTH-KV:surname}</Parameter>
</ContentDefinitionParameters>
<ScriptExecution>Allow</ScriptExecution>
</UserJourneyBehaviors>
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="displayName" />
<OutputClaim ClaimTypeReferenceId="email" />
<OutputClaim ClaimTypeReferenceId="emails" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="identityProvider" />
<OutputClaim ClaimTypeReferenceId="surname" />
<OutputClaim ClaimTypeReferenceId="newUser" />
<OutputClaim ClaimTypeReferenceId="objectId" />
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" />
<OutputClaim ClaimTypeReferenceId="trustFrameworkPolicy" Required="true" DefaultValue="{policy}" />
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
</TrustFrameworkPolicy>
Hyperproof LocalDev.onmicrosoft.com
B2C_1A_信任框架扩展
滚动的
86400
{OIDC:LoginHint}
{OAUTH-KV:givenName}
{OAUTH-KV:姓氏}
容许
保单简介
用户对象具有其他邮件属性,而不是电子邮件属性,这就是发生错误的原因
假设您已经声明了signInNames.emailAddress和OtherMail声明类型,那么您必须修改AAD UserCreateEmailsClaim技术配置文件,如下所示,要在输出处理用户对象之前读取的signInNames.emailAddress和其他邮件属性,请执行以下操作:
阅读
真的
假的
在您的AAD技术配置文件中(在验证消息中提到),您有电子邮件
作为输出声明
。但是,AD Graph(AzureActiveDirectoryProvider使用的)中不存在这样的属性。IEF在抱怨,因为它无法获取其价值
添加outputClaimTransformation
♧, <代码>电子邮件
声明将被创建,因为它是转换的输出声明
。它不需要添加到技术配置文件中
最近添加此检查是为了帮助保单作者了解哪些索赔无法来源,但由于文档原因,目前正在关闭。它将被添加一次,根据这些反馈,我们可以找出如何推广它,同时我们还可以帮助政策制定者轻松解决这些问题。谢谢Chris。这似乎让我克服了电子邮件的问题。正如在最初的错误中所指出的,我在AlternativeSecurityID中看到了类似的问题。按照阿披舍克·阿格拉瓦尔的建议,我正在以入门包为基础,重建我们的政策。我希望在今天晚些时候加入另一篇seurityids文章,并希望在那时结束这篇文章。嗨,安德鲁。您能否在上述问题中添加技术配置文件,其中提到了“AlternativeSecurityID”声明?使用中的信息(有一些问题)和帐户链接示例(有点问题),我已经能够解决以前的问题。我能够在新的TrustFrameworkBase.xml
中使用AlternativeSecurityId和AAD UserWriteSingaAlternativeSecurityId向AAD UserRead添加备用安全ID。“我还有更多的工作要做,以使帐户链接正常工作,但我想我已解除了阻止。@AndrewMiller您是如何解决与AlternativeSecurityID相关的错误的?”?我还收到了一个。Azure Active Directory提供程序技术配置文件“AAD UserWriteUsingAlternativeSecurityId”中不支持输入声明“AlternativeSecurityId”
在开始使用自定义策略时,一般建议从已启动的包开始,然后继续工作以实现特定场景。如果您仍遇到此问题,请告知我们,我们可以更新问题/答案Hanks Abhishek。因为我们对帐户链接感兴趣,所以我从高级示例中的帐户链接示例开始。我将以starter pack为基础重新开始练习并报告。让我看看帐户链接示例是否有任何问题。Abishek我从零开始使用starter pack中的SocialAndLocalAccounts策略文件。我添加了我们的首选社交提供商(谷歌),然后上传了所有文件,没有错误。然后,我根据上面的描述添加了对电子邮件声明的支持,并得到了关于不支持电子邮件的相同错误。我相信@ChrisPadgett已经回答了上面的问题。
<TechnicalProfile Id="AAD-UserCreateEmailsClaim">
<Metadata>
<Item Key="Operation">Read</Item>
<Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" Required="true" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="emails" />
</OutputClaims>
<OutputClaimsTransformations>
<OutputClaimsTransformation ReferenceId="GetFirstOtherMail"/>
<OutputClaimsTransformation ReferenceId="CopySignInNamesEmailToEmails"/>
<OutputClaimsTransformation ReferenceId="CopyFirstOtherMailToEmails"/>
</OutputClaimsTransformations>
<IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
PolicySchemaVersion="0.3.0.0"
TenantId="hyperprooflocaldev.onmicrosoft.com"
PolicyId="B2C_1A_SignUp"
PublicPolicyUri="http://hyperprooflocaldev.onmicrosoft.com/B2C_1A_SignUp"
DeploymentMode="Development"
UserJourneyRecorderEndpoint="urn:journeyrecorder:applicationinsights"
>
<BasePolicy>
<TenantId>hyperprooflocaldev.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>
<RelyingParty>
<DefaultUserJourney ReferenceId="SignUp" />
<UserJourneyBehaviors>
<SessionExpiryType>Rolling</SessionExpiryType>
<SessionExpiryInSeconds>86400</SessionExpiryInSeconds>
<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="451d3a92-fb38-4a1b-9b77-2f6572677090" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />
<ContentDefinitionParameters>
<Parameter Name="emailAddress">{OIDC:LoginHint}</Parameter>
<Parameter Name="givenName">{OAUTH-KV:givenName}</Parameter>
<Parameter Name="surname">{OAUTH-KV:surname}</Parameter>
</ContentDefinitionParameters>
<ScriptExecution>Allow</ScriptExecution>
</UserJourneyBehaviors>
<TechnicalProfile Id="PolicyProfile">
<DisplayName>PolicyProfile</DisplayName>
<Protocol Name="OpenIdConnect" />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="displayName" />
<OutputClaim ClaimTypeReferenceId="email" />
<OutputClaim ClaimTypeReferenceId="emails" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="identityProvider" />
<OutputClaim ClaimTypeReferenceId="surname" />
<OutputClaim ClaimTypeReferenceId="newUser" />
<OutputClaim ClaimTypeReferenceId="objectId" />
<OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" />
<OutputClaim ClaimTypeReferenceId="trustFrameworkPolicy" Required="true" DefaultValue="{policy}" />
</OutputClaims>
<SubjectNamingInfo ClaimType="sub" />
</TechnicalProfile>
</RelyingParty>
</TrustFrameworkPolicy>