<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

How to Change the Username of an OIDC Application in Okta

API Access Management
Okta Classic Engine
Okta Identity Engine

Overview

By default, Okta OIDC applications populate the preferred_username claim in the ID token with the user's primary email address (userName), which may not meet requirements when an application expects a custom username format. This issue is resolved by updating the application's attribute mappings in the Okta Profile Editor to map the desired profile attribute or custom Okta Expression Language value.

Applies To

  • OpenID Connect (OIDC) 
  • Okta Identity Engine (OIE)
  • Okta Classic Engine
  • Profile Editor & Attribute Mapping

Solution

What requirements are needed for changing the Username of an OIDC Application?

  • By default, the preferred_username claim is mapped as the "userName" in the application user profile, which will be populated as the primary email address of the user.
  • In order to receive the preferred_username claim in the user's ID token, the profile scope must be included in the /authorize request (specified in the app code/service provider's configuration dashboard).

How to modify the attributes from the Claim?

  1. Log in to the Okta Admin Console.
  2. Navigate to Directory > Profile Editor.
  3. Select Apps and locate the OIDC application.
  4. Click Mappings.
  5. In the profile mappings section, modify the following:profile mappings section
  6. Click Save Mappings and apply changes to existing users if prompted.

The preferred_username claim can be modified to return a different value from the user's profile. (even a custom expression value can be used)

 

Related References

 

Loading
Okta Support - How to Change the Username of an OIDC Application in Okta