I'm following this example to implement self-service password reset:
https://github.com/azure-ad-b2c/samples/tree/master/policies/embedded-password-reset
I was able to get the password reset working (prompt for email, verify email, change password, redirect to jwt.ms)
When I try it again (without prompt=login
), I was expecting to be redirected to the reply url (jwt.ms) since there should now be a session.
Instead, I'm immediately redirected to the "Verification is necessary" email dialog again.
I'm guessing it's because of the "isForgotPassword" claim?
How can I fix this?
Thanks
JL
Edit 1
No luck with the PasswordResetUsingEmailAddressExchange
.
If I add make these changes, it seem to work.
But not sure if it's an ideal solution.
Can anyone review/comment on the solution?
<!-- extend email discovery (discover/verify email) to use session management -->
<TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
<UseTechnicalProfileForSessionManagement ReferenceId="SM-AAD" />
</TechnicalProfile>
<!--
not technically needed.
but in my custom policy, I also have MFA subjourney
so I'm using this to skip MFA subjourney
(can't use objectId, because a successful login would
already set that claim)
-->
<TechnicalProfile Id="SM-AAD">
<PersistedClaims>
<PersistedClaim ClaimTypeReferenceId="isForgotPassword" />
</PersistedClaims>
</TechnicalProfile>
</TechnicalProfiles>
<OrchestrationStep Order="3" Type="InvokeSubJourney">
<Preconditions>
<!-- add start: if objectId is found (from session), skip subjourney -->
<Precondition Type="ClaimsExist" ExecuteActionsIf="true">
<Value>objectId</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
<!-- add end-->
<Precondition Type="ClaimsExist" ExecuteActionsIf="false">
<Value>isForgotPassword</Value>
<Action>SkipThisOrchestrationStep</Action>
</Precondition>
</Preconditions>
<JourneyList>
<Candidate SubJourneyReferenceId="PasswordReset" />
</JourneyList>
</OrchestrationStep>