Trying to limit the country list in multifactor authentication page in Azure ADB2C User Flow

Viewed 92

I have tried to limit the country list in authentication page by overriding the default json file in language customization like below. But that is not reflecting in the page.

 "LocalizedStrings": [
    {
      "ElementType": "UxElement",
      "ElementId": null,
      "StringId": "countryList",
      "Override": true,
      "Value": "{\"IN\":\"India\"}"
}
]
3 Answers

I found that I was doing changes in wrong page (i.e, multifactor authentication page). These are the steps

  1. Click Your User Flow
  2. Languages -> Click 'Enable Language Customization' in the menu if it's not enabled
  3. Select the language
  4. Click phone signin page in flyout menu and download the defaults json
  5. Then add this
"LocalizedCollections": [
    {
      "ElementType": "ClaimType",
      "ElementId": "countryCode",
      "TargetCollection": "Restriction",
      "Override": true,
      "Items": [
        {
          "Name": "India(+91)",
          "Value": "IN"
        }
      ]
    }
  ]
  1. Upload this json.

Have a look at this post.

Here's an example:

<LocalizedString ElementType="UxElement" StringId="countryList">{"DEFAULT":"Country/Region","AU":"Australia","NZ":"New Zealand"}</LocalizedString>

You can customize the country list by downloading the strings for the Multifactor Authentication Page by going to your B2C resource in the Azure Portal and navigating to:

  1. Your policy (assuming this is a SUSI policy)
  2. Customize -> Languages
  3. Click 'Enable Language Customization' in the menu if it's not enabled
  4. Select the language you want to customize ('EN' in my case)
  5. In the flyout menu, find the "Multifactor authentication page" section under "Page level resource files", and expand this section
  6. Click "download defaults (en)"
  7. Open the downloaded JSON file in your editor
  8. Edit the JSON by removing/modifying entries to the StringId countryList which is of ElementType UxElement. Make sure you also set the Override value to true. My example is:
{
  "LocalizedStrings": [
    {
      "ElementType": "UxElement",
      "ElementId": null,
      "StringId": "countryList",
      "Override": true,
      "Value": "{\"IN\":\"India\"}"
    }
  ]
}
  1. Save the file and upload as an override by using the file selector control.
  2. You may have to refresh your browser, but you should see the changes take.

MFA Collect Phone Number Screenshot

The other issue is that you're uploading an override for the wrong page template. The one I used for a screenshot was "Multifactor phone authentication" for a SUSI User Flow. The page template looks to be phonefactor.

Related