'Is there a way to force email verification in Azure B2C before allowing user to click Create or update the vague error message when not verified?

I have an Azure AD B2C Sign up and sing in policy and would like to improve the user experience for creating an account. If a new user does not click the Send verification code button and fills out the remainder of the form fields when creating a new Azure AD B2C account they receive a "A required field is missing. Please fill out all required fields and try again.":

screenshot with ambiguous error message

Most users are confused on what the missing required field is, as there is no input simply a button to Send verification code. I would like to either force a user to click the button and verify their email before they are able to click the Create button or provide a more descriptive error message like: "A required field is missing or the Email Verification Code has not been sent/verified".

Does anyone know how I can do either of these without going down the custom page content route?



Solution 1:[1]

If it is ,Signin sign up user flow ,error messages or flow can be customized only through user interface with HTML templates ,which looks like don't prefer as you said "without going down the custom page content route"

You can make use of localization , if you use Custom policies which uses TrustFrameworkExtensions.xml

The IDs for a content definition with an ID of api.localaccountsignup. Localization string IDs - Azure Active Directory B2C | Microsoft Docs / localization-string-ids

  • You need to make changes in the appropriate “api.xxx” action. In this case, it’s “api.localaccountsignup”.
  • The XML changes to the TrustFrameworkExtensions.xml file are:

ID : error_requiredFieldMissing
Default value : A required field is missing. Please fill out all required fields and try again.

<LocalizedResources Id="api.localaccountsignup.en">
...
<LocalizedString ElementType="UxElement" StringId="error_requiredFieldMissing">A required field is missing. Please fill out all required fields and try again.</LocalizedString>
...
<LocalizedResources Id="api.localaccountsignup.en">

We may need to Change to

<Localization Enabled="true">
  <SupportedLanguages DefaultLanguage="en" MergeBehavior="ReplaceAll">
    <SupportedLanguage>en</SupportedLanguage>
  </SupportedLanguages>
  <LocalizedResources Id="api.localaccountsignup.en">

   #Change the error message here
    <LocalizedStrings>
<LocalizedString ElementType="UxElement" StringId="error_requiredFieldMissing">A required field is missing or the Email Verification Code has not been sent/verified as not clicked on send verification code</LocalizedString>
    </LocalizedStrings>

  </LocalizedResources>
</Localization>

Please Refer:

  1. Customising the message/error text in Azure AD B2C custom policies | by Rory Braybrook
  2. get-a-proper-error-message or customising/localizin the error in b2c-custom-policies
  3. Localization string IDs - verification-display-control| Microsoft Docs

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 kavyasaraboju-MT