我们正在使用B2C自定义政策。我们有一个validate函数,该函数在用户浏览自声明页面后在注册时调用。如果电子邮件与内部部署的用户数据库匹配,则返回扩展声明“已验证”。它还会在此时返回用户的手机号码。
如果电子邮件不匹配,我们将进行PhoneFactor代码验证。
我现在想更新extension_Verified标志,但找不到解决方法。
我可以创建新的声明,但是之后我无法基于这两个声明设置前提条件(想要验证移动设备,如果“验证的”为假)。
我尝试使用声明转换,但是这些似乎仅适用于字符串声明(extension_Verified为布尔值)。
我尝试使用PartnerClaimType =“ extension_MobileVerified”,但它似乎没有更新。
<TechnicalProfiles>
<TechnicalProfile Id="PhoneFactor-InputOrVerify">
<DisplayName>PhoneFactor</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.PhoneFactorProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.phonefactor</Item>
<Item Key="ManualPhoneNumberEntryAllowed">false</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<InputClaimsTransformations>
<InputClaimsTransformation ReferenceId="CreateUserIdForMFA" />
</InputClaimsTransformations>
<InputClaims>
<InputClaim ClaimTypeReferenceId="userIdForMFA" PartnerClaimType="UserId" />
<InputClaim ClaimTypeReferenceId="extension_MemberMobile"/>
<InputClaim ClaimTypeReferenceId="strongAuthenticationPhoneNumber"/>
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="Verified.strongAuthenticationPhoneNumber" PartnerClaimType="Verified.OfficePhone"/>
<!-- OfficePhone -->
<OutputClaim ClaimTypeReferenceId="newPhoneNumberEntered" PartnerClaimType="newPhoneNumberEntered"/>
<OutputClaim ClaimTypeReferenceId="extension_MobileVerified" DefaultValue="true" />
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-MFA" />
</TechnicalProfile>
这确实显示了手机号码,但不允许输入,并返回了新的索偿要求。
如何更新现有的索赔?
答案 0 :(得分:1)
自定义属性也有类似的问题。 我按照步骤添加了自定义属性here。 Here是达到相同目的的一些示例。
我必须确保从上一步正确传递了声明,因此在上一步中添加了AAD-UserReadUsingObjectId。以下是我的代码
</OrchestrationStep>
<OrchestrationStep Order="3" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="4" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="false">
<Value>extension_forceChange</Value>
<Value>true</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="NewCredentials1" TechnicalProfileReferenceId="LocalAccountWritePasswordChangeUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
我还推荐了this来解决我的问题。