You should be able to utilize the validation technical profile that is described here : https://learn.microsoft.com/en-us/azure/active-directory-b2c/validation-technical-profile
Here you can customize the error and what items to check.
Per the doc :
* A validation technical profile can be conditionally executed based on preconditions defined in the ValidationTechnicalProfile element. For example, you can check whether a specific claims exists, or if a claim is equal or not to the specified value.*
In addition to that you can also utilize REST API Validation for even more customization, this is documented here : https://learn.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-rest-api-validation-custom
From the doc :
Include the RESTful service claims exchange in self-asserted technical profile where you want to validate the user input
The most common use of the validation step is in the interaction with a user. All interactions where the user is expected to provide input are self-asserted technical profiles. For this example, we will add the validation to the Self-Asserted-ProfileUpdate technical profile. This is the technical profile that the relying party (RP) policy file Profile Edit uses.
To add the claims exchange to the self-asserted technical profile:
Open the TrustFrameworkBase.xml file and search for .
Review the configuration of this technical profile. Observe how the exchange with the user is defined as claims that will be asked of the user (input claims) and claims that will be expected back from the self-asserted provider (output claims).
Search for TechnicalProfileReferenceId="SelfAsserted-ProfileUpdate, and notice that this profile is invoked as orchestration step 5 of .