1. Introduction
The locale and country attributes in the LibraCyber platform need to use values based on ISO 639 and ISO 3166-1 alpha-2 codes. For example, a user in the UK who speaks English would have locale=en and country=UK.
If your Microsoft Entra User profile doesn't have these specific values, here are some tips to help you figure them out from other attributes.
2. Key Terms
- Microsoft Entra: Microsoft's online identity service that helps manage user access and security.
- Provisioning: Automatically creating, updating, or removing user accounts in a connected app based on info in Microsoft Entra.
- Application: Any online service or tool your organization uses (like HR software or a cloud-based service).
- SCIM: A protocol that makes user provisioning easier (if your app supports SCIM).
- Expression builder helps you manage transformation rules and test expressions to use in attribute mapping.
3. Before You Begin
- Make sure you have admin access to Microsoft Entra. If you're not sure, check with your IT support.
4. Fixed value for locale and country
Use this when all users are from the same country and speak the same language.
In attribute mapping, we'll use a constant value. For example, if all users are in France, set locale to "fr" and country to "FR" by choosing "Constant" as the mapping type.
5. Deriving locale and country from Preferred Language
Use this if the Preferred Language attribute in the user profile has the value <two letters for language>-<two letters for country> (following the RFC 4646 standard).
For example: en-US, which means "English" for the language and US for the country.
If that's the case, you can use the Mid function in the expression builder to pull out the two values as substrings. Here's how you can set it up in attribute mapping.
For locale:
Mid([preferredLanguage],"1","2")For country:
Mid([preferredLanguage],"4","2")
6. Evaluate locale and country from other attributes
If there's no attribute in the user profile with the values LibraCyber expects for locale and country, but you have other attributes you can use to figure them out, here's what to do.
For example, you might have a "city" attribute with possible values like:
- Rome
- Turin
- Berlin
- London
- Paris
You can use the Switch function to set the locale and country based on the city attribute value:
For locale:
Switch([preferredLanguage], ToLower([city], ), "Rome", "it", "Turin", "it", "Berlin", "de", "London", "en", "Paris", "fr")For country:
Switch([preferredLanguage], ToLower([city], ), "Rome", "IT", "Turin", "IT", "Berlin", "DE", "London", "UK", "Paris", "FR")Note: The first attribute in the Switch function is the "default" value. If there's no match with the city attribute, it will use the value from "preferredLanguage." That's why it's important that the city attribute must have a value included in the Switch function. If you add users from other cities, you'll need to update the Switch function to include them.