Azure B2C login hint is not correct

Viewed 171

I have an azure b2c custom flow. Everything works fine except when the user clicks the login button a hint shows up attached to the username that say “please match the requested format”. Why is this showing up? I don’t see anywhere in the base/extensions/ signup in files that has this restriction or message.

1 Answers

For this issue, the problem was related to the claim type. In my TrustFrameworkExtensions file, I needed to define a claimtype to override the default behavior. The required changes was to add a restrictions setting and HelpText. Something like this:

<ClaimType Id="signInName">
  <DisplayName>Username</DisplayName>
  <DataType>string</DataType>
  <UserHelpText />
  <UserInputType>TextBox</UserInputType>
  <Restriction>
    <Pattern RegularExpression="^[a-zA-Z0-9]*$" HelpText="Invalid username bro" />
  </Restriction>
</ClaimType>
Related