<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

Configuring a Custom Username Format for SAML Applications in Okta

Single Sign-On
Okta Classic Engine
Okta Identity Engine

Overview

Configuring a custom username format, such as <DOMAIN>\<username>, for Security Assertion Markup Language (SAML) applications in Okta requires modifying the application sign-on settings and defining custom SAML attribute statements. Administrators must customize attributes using the Okta Expression Language (OEL) to ensure the correct username format passes to the application during authentication.

Applies To

  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Security Assertion Markup Language (SAML) Applications
  • Custom Username Format

Solution

How is a custom username format configured?

Modify the application username format in the Okta Admin Console and apply an Okta Expression Language (OEL) statement to customize the attribute.

  1. In the Okta Admin Console, navigate to Applications > Applications.
  2. Select the SAML application.
  3. Select the Sign On tab and select Edit.
  4. Choose Custom from the Application username format dropdown menu.

Custom Username format

  1. Enter the OEL statement to customize the attributes.
    • The following OEL statement example converts a username like <ExampleUser@example.com> into a <DOMAIN>\<exampleuser> format.
      "<PUTYOURDOMAINHERE>" + "\" + String.toLowerCase(String.substringBefore(user.login, '@'))

 

The Custom SAML Attribute Statements Require Configuration in the Profile Editor

Identify the user attribute variable name in the Profile Editor and add the custom attribute to the SAML application settings.

  1. In the Okta Admin Console, navigate to Directory > Profile Editor.
  2. Examine the User (default) profile to identify the variable name of the user attribute. For example, the user attribute for the username combines the profile variable name with the username variable name, resulting in user.login.

Profile editor

 

  1. Navigate to Applications > Applications and select the SAML application.
  2. Select the Sign On tab and scroll to the Attribute Statements section.
  3. Expand the Show legacy configuration section and select Edit.
  4. Enter the name of the SAML attribute in the Name field and the variable for the user attribute in the Value field within the Profile Attribute Statements section.
  5. Select Save to finalize the changes.
AttributeStatement
 

Related References

Loading
Configuring a Custom Username Format for SAML Applications in Okta | Okta Support