Azure ad b2c 显示带有Azure AD B2C自定义密码重置策略的错误消息
我遵循了本文中的步骤以及AssertBooleanClaimiSequalValue 但是,我无法获取要显示的错误消息 我有一个自定义密码重置流的电子邮件链接。该链接验证用户,因此我不需要用户按照正常的密码重置流程验证电子邮件地址 当用户单击链接时,我设置了一个自定义属性,这样用户就不能单击链接两次。在这种情况下,我想显示一条错误消息Azure ad b2c 显示带有Azure AD B2C自定义密码重置策略的错误消息,azure-ad-b2c,Azure Ad B2c,我遵循了本文中的步骤以及AssertBooleanClaimiSequalValue 但是,我无法获取要显示的错误消息 我有一个自定义密码重置流的电子邮件链接。该链接验证用户,因此我不需要用户按照正常的密码重置流程验证电子邮件地址 当用户单击链接时,我设置了一个自定义属性,这样用户就不能单击链接两次。在这种情况下,我想显示一条错误消息 <UserJourney Id="PasswordReset-Custom"> <OrchestrationSteps>
<UserJourney Id="PasswordReset-Custom">
<OrchestrationSteps>
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="PasswordResetUsingEmailAddress" TechnicalProfileReferenceId="AAD-UserReadUsingEmailAddress" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="NewCredentials" TechnicalProfileReferenceId="LocalAccountWritePasswordUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="3" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="UpdateFlag" TechnicalProfileReferenceId="AAD-UserWriteProfileUsingObjectId" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="4" Type="SendClaims" CpimIssuerTechnicalProfileReferenceId="JwtIssuer" />
</OrchestrationSteps>
<ClientDefinition ReferenceId="DefaultWeb" />
</UserJourney>
AAD UserWriteProfileUsingObjectId写入一个标志以指示行程已完成
<TechnicalProfile Id="LocalAccountWritePasswordUsingObjectId">
<DisplayName>Change password (username)</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
<Item Key="UserMessageIfClaimsTransformationBooleanValueIsNotEqual">Process complete blah.</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="newPassword" Required="true" />
<OutputClaim ClaimTypeReferenceId="reenterPassword" Required="true" />
</OutputClaims>
<ValidationTechnicalProfiles>
<ValidationTechnicalProfile ReferenceId="AAD-UserWritePasswordUsingObjectId" />
</ValidationTechnicalProfiles>
</TechnicalProfile>
更改密码(用户名)
api.localaccountpasswordreset
处理完整的废话。
这具有验证TP和UserWritePasswordUsingObjectId
<TechnicalProfile Id="AAD-UserWritePasswordUsingObjectId">
<Metadata>
<Item Key="Operation">Write</Item>
<Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
</Metadata>
<IncludeInSso>false</IncludeInSso>
<InputClaims>
<InputClaim ClaimTypeReferenceId="objectId" Required="true" />
</InputClaims>
<PersistedClaims>
<PersistedClaim ClaimTypeReferenceId="objectId" />
<PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password"/>
</PersistedClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="dummyObjectId" />
</OutputClaims>
<OutputClaimsTransformations>
<OutputClaimsTransformation ReferenceId="EnsureCompletedIsTrue" />
</OutputClaimsTransformations>
<IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>
写
符合事实的
错误的
这有一个输出请求传输信息,确保重新完成
<ClaimsTransformation Id="EnsureCompletedIsTrue" TransformationMethod="AssertBooleanClaimIsEqualToValue">
<InputClaims>
<InputClaim ClaimTypeReferenceId="extension_Completed" TransformationClaimType="inputClaim" />
</InputClaims>
<InputParameters>
<InputParameter Id="valueToCompareTo" DataType="boolean" Value="true" />
</InputParameters>
</ClaimsTransformation>
因此,如果扩展_Completed为True,它应该抛出错误消息“processcomplete”
我已检查该标志是否为真,但从未看到错误消息?根据,它断言索赔值与预期值相同,否则抛出错误。你是在反对“真”,但不应该反对“假”吗
如果从未使用过链接,则声明值为false。验证是为了断言这是错误的。一旦它被使用,索赔值应该是真的(我相信你会在某个地方处理这个问题)。如果用户再次使用链接,则声明值现在为true,并且断言将抛出,因为它需要一个false值