<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
Okta Expression Language - Expression to Remove Spaces or Special Characters
Single Sign-On
Okta Classic Engine
Okta Identity Engine
Overview
This article will show a suggested line of Okta Expression Language (OEL) designed to remove space characters and special characters.
Applies To
  • Okta Expression Language (OEL)
Solution

Review the steps or video below to resolve the issue.


 

  1. Log in to the Okta Dashboard.
  2. Click on Directory and Profile Editor.
  3. Identify the variable name of the user attribute by looking at the User (default) profile.
  4. Click on Applications and select the Secure Assertion Markup Language (SAML) app that will have the custom attribute added.
  5. On the General tab, scroll down to the SAML Settings section.
  6. Click Edit to launch the App Configuration wizard.
  7. In the Attribute Statements (Optional) section, enter the name of the SAML attribute to be added.
  8. In the Value text box, enter the variable name from the Okta profile, prefixed with "user." (for example, user.title).
  9. Click Next and Finish to save the new SAML attribute statement.
  10. Navigate back to the App Configuration wizard and enter the following expression in the Value text box.
    String.removeSpaces(String.replace(String.replace(user.attribute, "&", "_"), ",", "_"))

This expression will remove spaces and replace special characters, ampersand (&) and comma (,) with underscores from a mapped attribute in Okta.
 

Related References

 

Loading
Okta Expression Language - Expression to Remove Spaces or Special Characters