我有一个现有的Azure B2C解决方案使用自定义策略,并提供注册/注册通过AAD,MS帐户,谷歌和本地。我现在添加由https://learn.microsoft.com/en-us/azure/active-directory-b2c/multi-factor-authentication?pivots=b2c-custom-policy提供的TOTP。
我已经注册/签名和密码重置策略使用TOTP为本地帐户工作。社交账户我不需要TOTP。但是,我正在努力使用ChangePassword策略,其中已经登录的用户可以更改他们的密码。对于这个步骤,我希望用户在更改密码之前通过TOTP验证自己。
在我的非TOTP解决方案中,我使用的是由PasswordChange UserJourney提供的https://learn.microsoft.com/en-us/azure/active-directory-b2c/add-password-change-policy?pivots=b2c-custom-policy
为了完整起见,它看起来如下:
<UserJourney Id="PasswordChange">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.signuporsignin">
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="LocalAccountSigninEmailExchange" />
</ClaimsProviderSelections>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="3" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordChangeUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="4" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="5" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
</OrchestrationSteps>
<ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>
我希望通过在旧策略的第2步和第3步之间插入TotpFactor-输入和TotpFactor-验证步骤,来解决PasswordChangeWithTOTP类似的问题。
<UserJourney Id="PasswordChangeWithTOTP">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsProviderSelection" ContentDefinitionReferenceId="api.signuporsignin">
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="LocalAccountSigninEmailExchange" />
</ClaimsProviderSelections>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="LocalAccountSigninEmailExchange" TechnicalProfileReferenceId="SelfAsserted-LocalAccountSignin-Email" />
</ClaimsExchanges>
</OrchestrationStep>
<!-- Call the TOTP enrollment ub journey. If user already enrolled the sub journey will not ask the user to enroll -->
<OrchestrationStep Order="3" Type="InvokeSubJourney">
<JourneyList>
<Candidate SubJourneyReferenceId="TotpFactor-Input" />
</JourneyList>
</OrchestrationStep>
<!-- Call the TOTP validation sub journey-->
<OrchestrationStep Order="4" Type="InvokeSubJourney">
<JourneyList>
<Candidate SubJourneyReferenceId="TotpFactor-Verify" />
</JourneyList>
</OrchestrationStep>
<OrchestrationStep Order="5" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordChangeUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="6" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="7" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
</OrchestrationSteps>
<ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>
小问题:由于使用应用程序的发布周期,我提出了一个新的策略,而且我并不完全相信我应该提供TOTP注册作为这一特定步骤的一部分,尽管这是我们为SignUpSignIn和PasswordReset做的事情。
在执行"Get available强身份验证设备“活动时,我得到的错误”服务收到了一个糟糕的请求“。错误消息的目标类型用户和Id与登录期间使用的类似操作一致。我看不出还有什么特别是从我身上跳出来的。
我确实尝试过在TotpFactor输入步骤之前插入一个<ClaimsExchange Id="AADUserReadWithObjectId" TechnicalProfileReferenceId="AAD-UserReadUsingObjectId" />
OrchestrationStep,但我认为这可能已经违背了TOTP的目的。在更改密码之前,也没有提示我提供验证代码。
使用TOTP策略的PasswordChange应该是什么样的呢?
发布于 2022-04-13 15:05:42
你有没有:
<OutputClaim ClaimTypeReferenceId="userPrincipalName" />
作为来自SelfAsserted-LocalAccountSignin-电子邮件的输出声明?
据我所知,从文档/示例中可以看出,userPrincipalName
是TOTP SubJourneys工作所必需的。
https://stackoverflow.com/questions/71837722
复制