【发布时间】:2021-02-16 01:16:58
【问题描述】:
我正在使用这个custom policy - “B2C IEF 自定义策略 - 使用 MFA 方法选择(电话/电子邮件)登录”。这很好用。
简介说“能够通过个人资料编辑更改此偏好”,但我在政策中没有看到这一点?
我的用例是用户可以更改 MFA 的电话号码或电子邮件地址,或者就 MFA 在两者之间切换(例如,将电话更改为电子邮件,反之亦然)。
最简单的方法是“重置”MFA 并要求用户再次启用 MFA。
所以我将“extension_mfaByPhoneOrEmail”设置为“重置”,然后政策说:
<!-- If user is enrolled for MFA, ask the user to select the preferred method -->
<OrchestrationStep Order="4" Type="ClaimsExchange">
<Preconditions>
<!-- If the preferred MFA method is 'phone' skip this orchestration step -->
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>extension_mfaByPhoneOrEmail</Value>
<Value>phone</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
<!-- If the preferred MFA method is 'email' skip this orchestration step -->
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>extension_mfaByPhoneOrEmail</Value>
<Value>email</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="SelfAsserted-Select-MFA-Method" TechnicalProfileReferenceId="SelfAsserted-Select-MFA-Method"/>
</ClaimsExchanges>
</OrchestrationStep>
但我从来没有看到“extension_mfaByPhoneOrEmail”单选按钮。
我还需要“重置”其他属性吗?
例如该策略使用“newPhoneNumberEntered”和“isActiveMFASession”?
或者有没有更好的方法来“重置”MFA?
更新
我最终通过deletingextension_mfaByPhoneOrEmail 声明解决了这个问题。
然后用户可以选择再次选择电子邮件或电话进行 MFA。
但如果用户已经在使用电话,它会显示“我们有一部电话记录在案”并且无法更改。
我通过使用“编辑 MFA”sample 解决了这个问题。
有什么办法可以清除电话号码?
此声明是您无法通过 DelateClaims 方法删除的声明之一。
更新 2
我包含了 DeleteClaims 和包含此内容的用户旅程部分。
如果您仍有问题,请尝试将“SelfAsserted-Select-MFA-Method”中的“extension_mfaByPhoneOrEmail”检查注释掉。
<TechnicalProfile Id="AAD-DeleteClaimsUsingObjectId">
<Metadata>
<Item Key="Operation">DeleteClaims</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" Required="true"/>
</InputClaims>
<PersistedClaims>
<PersistedClaim ClaimTypeReferenceId="objectId"/>
<PersistedClaim ClaimTypeReferenceId="extension_mfaByPhoneOrEmail"/>
<PersistedClaim ClaimTypeReferenceId="Verified.strongAuthenticationPhoneNumber" PartnerClaimType="strongAuthenticationPhoneNumber"/>
</PersistedClaims>
<OutputClaims/>
<IncludeTechnicalProfile ReferenceId="AAD-Common"/>
</TechnicalProfile>
<OrchestrationStep Order="3" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="B2CUserProfileDeleteExchange" TechnicalProfileReferenceId="AAD-DeleteClaimsUsingObjectId"/>
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="4" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="B2CUserProfileUpdateExchange" TechnicalProfileReferenceId="AAD-UserWriteProfileUsingObjectId"/>
</ClaimsExchanges>
</OrchestrationStep>
<!-- This step reads any user attributes that we may not have received when authenticating using ESTS so they can be sent
in the token. -->
<OrchestrationStep Order="5" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimEquals" ExecuteActionsIf="true">
<Value>authenticationSource</Value>
<Value>socialIdpAuthentication</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId"/>
</ClaimsExchanges>
</OrchestrationStep>
<!-- If user is enrolled for MFA, ask the user to change the preferred method or the email or phone number -->
<OrchestrationStep Order="6" Type="ClaimsExchange">
<Preconditions>
<Precondition Type="ClaimsExist" ExecuteActionsIf="true">
<Value>extension_mfaByPhoneOrEmail</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<ClaimsExchanges>
<ClaimsExchange Id="SelfAsserted-Select-MFA-Method" TechnicalProfileReferenceId="SelfAsserted-Select-MFA-Method"/>
</ClaimsExchanges>
</OrchestrationStep>
【问题讨论】:
-
嗨,我也面临同样的问题。您能否分享您在自定义策略中所做的更改以使其发挥作用?我从过去 2 天开始摸不着头脑以使其发挥作用。它适用于新用户,问题只是在重置 MFA 时,提前感谢
-
完成 - 如上所述。
标签: azure-ad-b2c