0

Currently Implementing a b2c signup flow via custom policies. Working on a usecase for b2c user registration page, when a user left the “required fields” as empty then the following error message is displayed as “This information is required” by default.

But how to customize to these mandatory field error message as “Name is required” or “Phone number is required” or “Telephone number is required”?

I haven’t found a right localization string ID to handle these mandatory field error message, Instead of a generic default error message. Any helpful suggestions?

3 Answers3

0

The specific string ID will vary depending on the claim. Use Customize Language guidance via XML policy to edit Localization element for the localized string.

See page layout version for your specific ID (if you require a version update).

enter image description here

Chad Hasbrook
  • 206
  • 1
  • 6
0

I think you have to use localization to overwrite messages and texts.

<LocalizedResources Id="api.signuporsignin.en">
    <LocalizedStrings>
        <LocalizedString ElementType="ClaimType" ElementId="email" StringId="DisplayName">Email Address</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="heading">Sign in</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="social_intro">Sign in with your social account</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="local_intro_generic">Sign in with your {0}</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="requiredField_password">Please enter your password</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="requiredField_generic">Please enter your {0}</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="invalid_generic">Please enter a valid {0}</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="createaccount_one_link">Sign up now</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="createaccount_two_links">Sign up with {0} or {1}</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="createaccount_three_links">Sign up with {0}, {1}, or {2}</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="forgotpassword_link">Forgot your password?</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="button_signin">Sign in</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="divider_title">OR</LocalizedString>
        <LocalizedString ElementType="UxElement" StringId="unknown_error">We are having trouble signing you in. Please try again later.</LocalizedString>
        <!-- Uncomment the remember_me only if the keep me signed in is activated. 
        <LocalizedString ElementType="UxElement" StringId="remember_me">Keep me signed in</LocalizedString> -->
        <LocalizedString ElementType="ClaimsProvider" StringId="FacebookExchange">Facebook</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">Your password is incorrect.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfPasswordExpired">Your password has expired.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">We can't seem to find your account.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfOldPasswordUsed">Looks like you used an old password.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="DefaultMessage">Invalid username or password.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountDisabled">Your account has been locked. Contact your support person to unlock it, then try again.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfUserAccountLocked">Your account is temporarily locked to prevent unauthorized use. Try again later.</LocalizedString>
        <LocalizedString ElementType="ErrorMessage" StringId="AADRequestsThrottled">There are too many requests at this moment. Please wait for some time and try again.</LocalizedString>
    </LocalizedStrings>
</LocalizedResources>
cmaluenda
  • 2,099
  • 1
  • 14
  • 15
0

I noticed in the example you posted, you had "UserMessageIfMissingRequiredElemnt" rather than "UserMessageIfMissingRequiredElement" (yours is missing that final "e"), this is perhaps why the localization didn't work

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
  • Hi. While replying in this thread forgot to add ‘e’. But in the code I have added a current localization element as per the given documentation. So, now Implement a separation validation to each required claims in the policy that are part of the display claims. – CloudSpace03 Nov 07 '22 at 18:58