<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
Convert an AD User's Phone Number to E.164 US Format in Okta
Single Sign-On
Lifecycle Management
Okta Classic Engine
Okta Identity Engine
Overview

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.

Applies To
  • Okta Expression Language
  • AD Mastered Users
  • RingCentral
  • Phone applications that need E.164 format
Solution

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.

  1. Navigate to Directory > Profile Editor > Directories > Active Directory > Mappings in the Okta Admin Dashboard.

Mappings

  1. Utilize Okta expression language to modify the phone number format.

  2. Use the "String.replace" function to eliminate dashes, parentheses, and spaces from the phone number.

  3. Use the "String.append" function to add "+1" at the start of the phone number.

  4. 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, "-", ""), "(", ""), ")", ""), " ", ""))

Okta expression language code to convert the phone number 

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.

Loading
Convert an AD User's Phone Number to E.164 US Format in Okta