question

YogeshAgrawal-8809 avatar image
0 Votes"
YogeshAgrawal-8809 asked YogeshAgrawal-8809 answered

Customaize UI placeholder messages & error messages based on query params

Hi,
Is there's any way to customize the default placeholder messages and error messages in the login form
55356-b2c-ui-issue.png




We're customizing this screen using query params, as a single B2C tenant is used across multiple apps, and it's not possible to create and upload policy for each app.

azure-ad-b2c
b2c-ui-issue.png (34.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered YogeshAgrawal-8809 commented

Hello @YogeshAgrawal-8809 · Thank you for reaching out.

Please find below the parameters to customize the messages, you have highlighted in your question.

 <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfClaimsPrincipalDoesNotExist">The username or password provided in the request are invalid.</LocalizedString>
 <LocalizedString ElementType="ErrorMessage" StringId="UserMessageIfInvalidPassword">The username or password provided in the request are invalid.</LocalizedString>

With above parameters, for both invalid username and invalid password, it will return same message, which is "The username or password provided in the request are invalid."

     <LocalizedString ElementType="UxElement" StringId="required_field">This information is required.</LocalizedString>

above parameter can be used to customize "This information is required." message.

Read More: https://docs.microsoft.com/en-us/azure/active-directory-b2c/localization-string-ids#sign-up-or-sign-in-example

Use UserHelpText parameter for the pre-populated text in a given text box, under the claims schema where the sign in and password claims are defined. Please refer to UserHelpText parameter in the examples documented here: ClaimsSchema


Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks, @amanpreetsingh-msft for the quick reply.
Need your help to change default wrong password message. Not found such in the above link you've shared.


55668-wrong-password-msg.png


0 Votes 0 ·

Hi @YogeshAgrawal-8809 · This can be customized using StringId="UserMessageIfInvalidPassword" as mentioned in my Answer above.

0 Votes 0 ·
YogeshAgrawal-8809 avatar image
0 Votes"
YogeshAgrawal-8809 answered

Hi @amanpreetsingh-msft

Changed StringId="UserMessageIfInvalidPassword in policy, but seems not working.
Attached the screenshots of the changes, did in the policy XML file.

Kindly check.

56331-ad-b2c-localized-strings.png56303-ad-b2c-msg-not-changed.png



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.