AAD B2C Custom Policy - show password helper text by default

830 Views Asked by At

I would like my AAD B2C Sign In flow created using custom policies to display password helper text by default, so that user knows upfront what are the password requirements, before having to type insufficiently secure password. Is it possible without injecting custom html element to registration form?

This is password claim type definition:

     <ClaimType Id="newPassword">
        <DisplayName>New Password</DisplayName>
        <DataType>string</DataType>
        <UserHelpText>Enter new password</UserHelpText>
        <UserInputType>Password</UserInputType>
        <Restriction>
          <Pattern RegularExpression="^((?=.*[a-z])(?=.*[A-Z])(?=.*\d)|(?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9])|(?=.*[a-z])(?=.*\d)(?=.*[^A-Za-z0-9])|(?=.*[A-Z])(?=.*\d)(?=.*[^A-Za-z0-9]))([A-Za-z\d@#$%^&amp;*\-_+=[\]{}|\\:',?/`~&quot;();!]|\.(?!@)){8,16}$" HelpText="8-16 characters, containing 3 out of 4 of the following: Lowercase characters, uppercase characters, digits (0-9), and one or more of the following symbols: @ # $ % ^ &amp; * - _ + = [ ] { } | \ : ' , ? / ` ~ &quot; ( ) ; ." />
        </Restriction>
      </ClaimType>
1

There are 1 best solutions below

0
On

To add elements to the login page, you'll need to use JavaScript in your custom UI to inject the element right before or after your password prompt.

This example for instance uses such technique to inject a terms of use link on the page. You can use a similar technique to accomplish your goal. As far as I know there is no way from the policy xml itself to create what you are referring to.