Customize validation message Azure B2C app login/signup form

Ciaran Mallory 21 Reputation points
2022-11-14T16:23:05.633+00:00

Hi all,

We have an Azure B2C application which is using custom policies for the login/signup flow. When a user enters their email various validation messages are shown if there is an issue with the email entry as shown below. The issue being faced is that there doesn't seem to be a way to edit/remove the text such as "Please match the requested format" shown below. The policy allows us to edit the below message in the message using the pattern attribute but not the title part. Does anyone know if there is a way to edit this text in custom policies or does it have to be done with Javascript manipulation in the code files. If it could be changed in the policy this would help greatly as multiple development teams are using this same flow and requesting this change.

Current policy claim for changing this message:
<ClaimType Id="signInName">
<DisplayName>Enter your Email address</DisplayName>
<UserHelpText>Email address to use for signing in.</UserHelpText>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.+!#$%&'+^_{}~-]+(?:\.[a-zA-Z0-9!#$%&amp;'+^_{}~-]+)*@(?:a-zA-Z0-9?.)+a-zA-Z0-9?$" HelpText="The email you provided is not valid." />
</Restriction>
</ClaimType>

Thanks in advance, Ciaran.260194-validationimage.png

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

Accepted answer
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2022-11-14T20:36:38.137+00:00

    Hi @Ciaran Mallory , thanks for the question. I answered a question similar to this a few months ago but am having trouble finding it. If I do I'll post back here.

    This thread details how you can remove the message, but not change it. This is unfortunately one of the current limitations Azure has for authentication. You currently can't evaluate the password complexity requirements and change the message to match. I recommend submitting a feature request here for it. My workaround would be to create your own input form and evaluator/message with JavaScript and then pass that through.

    I'm going to keep looking for a more detailed answer but wanted to provide you with this so far. Please let me know if you have any questions in the meantime.

    Best,
    James


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.