Azure-Samples / active-directory-b2c-custom-policy-starterpack

Azure AD B2C now allows uploading of a Custom Policy which allows full control and customization of the Identity Experience Framework
http://aka.ms/aadb2ccustom
MIT License
325 stars 386 forks source link

Localization documentation #6

Open onionhammer opened 6 years ago

onionhammer commented 6 years ago

Hi guys,

I've been able to piece together quite a bit from just looking over the samples, but I'm struggling to localize messages like this: https://github.com/Azure-Samples/active-directory-b2c-custom-policy-starterpack/blob/master/LocalAccounts/TrustFrameworkBase.xml#L487

Im able to localize several fields that appear on the page (like the labels, username, etc), but I'm not sure how to localize the error messages that come back if the user doesnt exist/password is wrong/etc.

Where is the actual documentation on all of this?

iliosana commented 2 years ago

I've had the same problem and was able to solve it by adding the following:

<Item Key="UserMessageIfInvalidPassword">Your custom message 1</Item>
<Item Key="UserMessageIfClaimsPrincipalDoesNotExist">Your custom message 2</Item>

as items in the Metadata tag in the technical profile: "login-NonInteractive" in the TrustFrameworkBase.xml file.

For me, it didn't work when adding the localization in another technical profile or the TrustFrameworkLocalization.xml. Also, make sure to replace {tenant} with your actual tenant name (e.g. xyz.onmicrosoft.com) in your base file.

In case you still have problems, try commenting out

<Item Key="grant_type">password</Item>

in the technical profile profile: "login-NonInteractive" in the TrustFrameworkBase.xml file.