Ger*_*riz 3 azure azure-ad-b2c
我使用的是自定义策略,我看到内置策略中存在“电子邮件”字段,但自定义策略中不存在该字段。otherMails
而是有一个索取名称。
emails
用用户电子邮件列表返回令牌中的索赔。我正在使用入门包中的自定义策略。但是我不知道该TechnicalProfiles
改哪个。我尝试了几件事,但是没有用。
提前致谢!
编写本地帐户时:必须使用“ CreateOtherMailsFromEmail”声明转换从“ email”声明创建“ otherMails”声明,然后将“ otherMails”声明保留在“ AAD-UserWriteUsingLogonEmail”技术配置文件中:
<TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
...
<IncludeInSso>false</IncludeInSso>
<InputClaimsTransformations>
<InputClaimsTransformation ReferenceId="CreateOtherMailsFromEmail" />
</InputClaimsTransformations>
<InputClaims>
...
</InputClaims>
<PersistedClaims>
...
<PersistedClaim ClaimTypeReferenceId="otherMails" />
</PersistedClaims>
<OutputClaims>
...
<OutputClaim ClaimTypeReferenceId="otherMails" />
</OutputClaims>
...
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
然后,您必须从“ LocalAccountSignUpWithLogonEmail”技术资料中传递“ otherMails”声明,该资料被调用以注册本地帐户:
<TechnicalProfile Id="LocalAccountSignUpWithLogonEmail">
...
<OutputClaims>
...
<OutputClaim ClaimTypeReferenceId="otherMails" />
</OutputClaims>
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
编写社交帐户时:已经从“电子邮件”声明中创建了“ otherMails”声明,然后将其保留在“ AAD-UserWriteUsingAlternativeSecurityId”技术配置文件中。
然后,您必须将“ otherMails”声明从“ SelfAsserted-Social”技术资料传递出去,该资料被调用以注册社交帐户:
<TechnicalProfile Id="SelfAsserted-Social">
...
<OutputClaims>
...
<OutputClaim ClaimTypeReferenceId="otherMails" />
</OutputClaims>
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
在读取本地帐户或社交帐户时:在“ AAD-UserReadUsingObjectId”,“ AAD-UserReadUsingEmailAddress”和“ AAD-UserReadUsingAlternativeSecurityId”技术配置文件中已经读取了“ otherMails”声明。
然后,您必须从“ LocalAccountDiscoveryUsingEmailAddress”技术配置文件中传递“ otherMails”声明,并调用该技术配置文件来恢复本地密码:
<TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
...
<OutputClaims>
...
<OutputClaim ClaimTypeReferenceId="otherMails" />
</OutputClaims>
</TechnicalProfile>
Run Code Online (Sandbox Code Playgroud)
要从注册/登录和密码重置策略中将“ otherMails”声明作为“电子邮件”发布:您必须添加<OutputClaim />
关于依赖方策略的“ otherMails”声明:
<RelyingParty>
...
<TechnicalProfile Id="PolicyProfile">
<OutputClaims>
...
<OutputClaim ClaimTypeReferenceId="otherMails" PartnerClaimType="emails" />
</OutputClaims>
</TechnicalProfile>
</RelyingParty>
Run Code Online (Sandbox Code Playgroud)
对于 Chris Padgett 的回答,您可以将其他电子邮件(备用电子邮件)添加到声明中。
如果您只想将 SignIn 名称中的电子邮件声明添加到令牌中,您只需执行以下步骤:
打开你的SignUporSignIn.xml
文件
替换<OutputClaim ClaimTypeReferenceId="email" />
为<OutputClaim ClaimTypeReferenceId="signInNames.emailAddress" PartnerClaimType="email" />
保存此 SignUporSignIn.xml 文件并将其上传到 Azure AD B2C 以覆盖策略。
归档时间: |
|
查看次数: |
568 次 |
最近记录: |