Skipping the email verification step on password reset using azure b2c

Viewed 193

I want to skip the email verification on reset password and instead, I want to make an API call before allowing the user to define a new password.

I tried replace the fist step below

<OrchestrationStep Order="1" Type="ClaimsExchange">
  <ClaimsExchanges>
    <ClaimsExchange Id="PasswordResetUsingEmailAddressExchange" TechnicalProfileReferenceId="LocalAccountDiscoveryUsingEmailAddress" />
  </ClaimsExchanges>
</OrchestrationStep>

to

<OrchestrationStep Order="1" Type="ClaimsExchange">
  <ClaimsExchanges>
    <ClaimsExchange Id="UserReadUsingEmailAddressExchange" TechnicalProfileReferenceId="AAD-UserReadUsingEmailAddress" />
  </ClaimsExchanges>
</OrchestrationStep>

but got the error below

AADB2C90037: An error occurred while processing the request. Please contact administrator of the site you are trying to access. Correlation ID: 6ffea2fd-bc28-4d7c-8a92-abe63f3e5b54 Timestamp: 2021-04-13 14:42:24Z

on app insights I got

Exception Message:An error occurred while processing the request. Please contact administrator of the site you are trying to access., Exception Type:PolicyException, CorrelationID:6ffea2fd-bc28-4d7c-8a92-abe63f3e5b54

Does anyone know how to do it?

Many thanks

1 Answers

Disable Email Verification.

Apply this concept to the respective technical profile for the password reset journey. You do not need to modify the user journey at all.

<ClaimsProvider>
  <DisplayName>Local Account</DisplayName>
  <TechnicalProfiles>
    <TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
      <Metadata>
        <Item Key="EnforceEmailVerification">false</Item>
      </Metadata>
    </TechnicalProfile>
  </TechnicalProfiles>
</ClaimsProvider>

Call a REST API from within your journey.

The following reference teaches how to read and understand the custom policy. https://github.com/azure-ad-b2c/azureadb2ccommunity.io/wiki/LocalAccount-Sign-In-and-Sign-Up-policy

Related