<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

Using a String Function to Remove Apostrophes from Usernames

Administration
Okta Classic Engine
Okta Identity Engine
Single Sign-On
Okta Lifecycle Management

Overview

This article explains how to use a string function to return only alphabetical characters and remove apostrophes from a username.

Applies To

  • Expression Language
  • Custom Username Format

Solution

Follow the steps or video below:

To format a username like john.obrien@domain.com instead of john.o'brien@domain.com, use the following expression:

String.toLowerCase(user.firstName) + "." + String.toLowerCase(String.replace(user.lastName, "'", "")) + "@<domain>.com" 

 

NOTE: Replace <domain> with the desired domain name.

Loading
Okta Support - Using a String Function to Remove Apostrophes from Usernames