<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
Okta Classic Engine
Okta Identity Engine
API Access Management
Overview

This article details how to modify the preferred_username claim from the ID_token to a different value.

 

Applies To
  • OpenID Connect (OIDC)
Solution

General information and requirements:

  • 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 claim

  1. In the Okta Admin dashboard, navigate to Directory > Profile Editor
  2. Select the Apps section.
  3. Find the relevant OIDC app and select Mappings.
  4. In the profile mappings section, modify the following:

profile mappings section

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
How to Change the Username of an OIDC Application