How do you add translations to the globalexception page on Azure AD B2C using custom policies

Josh Jones 30 Reputation points
2025-01-06T17:36:31.8033333+00:00

Hi,

I am make using of Azure custom policies and am unable to find out how to translate the globalexception page.

I would expect to be able to translate the error heading and error description, but there is no mention of how to do this via the official documentation - https://zcusa.951200.xyz/en-us/azure/active-directory-b2c/localization-string-ids

The data contract that is being used is:

urn:com:microsoft:aad:b2c:elements:contract:globalexception:1.2.6

Attempted to use the following translations but does not work:

     <LocalizedResources Id="api.error.en">
        <LocalizedStrings>
          <LocalizedString ElementType="UxElement" StringId="heading">Reset your password</LocalizedString>
          <LocalizedString ElementType="ErrorMessage" StringId="DefaultError">An error occurred. Please try again.</LocalizedString>
        </LocalizedStrings>
      </LocalizedResources>

The Javascript best practices also mentions using the custom policies for translating error messages but does not provide examples of how - https://zcusa.951200.xyz/en-us/azure/active-directory-b2c/javascript-and-page-layout?pivots=b2c-custom-policy#guidelines-for-using-javascript

Example screenshot
Screenshot 2025-01-06 at 17.31.54

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,981 questions
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 26,881 Reputation points Microsoft Employee
    2025-01-10T19:33:09.04+00:00

    Hi @Josh Jones @Adam Woodcock , please add these localized strings in "api.signuporsignin" content definition instead of "api.error":

    image (2)

    image (3)

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.