The E.164 is a general format for international telephone numbers, and it might be required for some applications.
This article provides administrators with instructions on how to modify the phone number format of an Active Directory (AD) user in Okta to the E.164 US format using Okta expression language and offers an example code snippet. By following the steps outlined in the article, AD-mastered users' phone numbers can be updated to the necessary format in Okta.
- Okta Expression Language
- AD Mastered Users
- RingCentral
- Phone applications that need E.164 format
To convert the phone number of an imported user from Active Directory (AD) to E.164 US format in Okta, follow these steps or review the video.
-
Navigate to Directory > Profile Editor > Directories > Active Directory > Mappings in the Okta Admin Dashboard.
-
Utilize Okta expression language to modify the phone number format.
-
Use the "String.replace" function to eliminate dashes, parentheses, and spaces from the phone number.
-
Use the "String.append" function to add "+1" at the start of the phone number.
-
The resulting format should be in the format of "+14151234567" (where the original phone number is 415-123-4567).
Here is an example of the Okta expression language code to convert the phone number format:
String.append("+1", String.replace(String.replace(String.replace(String.replace(appuser.mobilePhone, "-", ""), "(", ""), ")", ""), " ", ""))
By utilizing this code, AD-mastered users' phone numbers can be modified in Okta to comply with the E.164 US format, which is necessary for phone applications that require it.
