azure-ad-b2c / samples

Azure AD B2C custom policy solutions and samples.
844 stars 597 forks source link

ForgotPasswordExchange condition check #205

Open apaulme opened 3 years ago

apaulme commented 3 years ago

i used the sample policy and noticed step 7 is getting executed all the time since isForgotPassword is default to true, so i changed the condition to check if user signed in with correct password we set the authenticationSource as localAccountAuthentication. if use that it will skip forgot password journey. please let me know what you think?

objectId SkipThisOrchestrationStep
            <OrchestrationStep Order="7" Type="ClaimsExchange">
                <Preconditions>
                    <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                    <Value>authenticationSource</Value>
                    <Action>SkipThisOrchestrationStep</Action>
                    </Precondition>
                </Preconditions>
                <ClaimsExchanges>
                    <ClaimsExchange Id="ForgotPasswordExchange" TechnicalProfileReferenceId="ForgotPassword" />
                </ClaimsExchanges>
            </OrchestrationStep>
JasSuri commented 3 years ago

Which sample policy and for what scenario are you testing?

apaulme commented 3 years ago

this one https://github.com/azure-ad-b2c/samples/tree/c6bc40a998e4169034262909cdb54b8f46c3ee62/policies/embedded-password-reset

existing b2c user trying to reset password or just signing in

                    <Preconditions>
                        <Precondition Type="ClaimsExist" ExecuteActionsIf="false">
                            <Value>objectId</Value>
                            <Action>SkipThisOrchestrationStep</Action>
                        </Precondition>                    
                        <Precondition Type="ClaimsExist" ExecuteActionsIf="true">
                        <Value>authenticationSource</Value>
                        <Action>SkipThisOrchestrationStep</Action>
                        </Precondition>
apaulme commented 3 years ago

I have it working now. I added 2 conditions to check for objectid and authentication source before calling forgot password technical profile.

On Wed, Apr 14, 2021, 2:36 PM Jas Suri @.***> wrote:

We took this doc down for now whilst we work on a fix for custom policy. It’s only working for user flow currently.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/azure-ad-b2c/samples/issues/205#issuecomment-819864855, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATP6ENOOAIOG73MCO4PCDCTTIYDHPANCNFSM42H4VPMQ .

francesconi commented 3 years ago

Experiencing the same issue.