<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
Updated "Locale" Value Not Reflected in ID/Access Tokens
Okta Identity Engine
Okta Classic Engine
API Access Management
Overview

Incorrect locale claim in ID/Access token.

If the "locale" attribute in the user's profile was updated to fr_CA (or other value), but that value is not seen in the tokens, then update the "locale" attribute expression and create a custom claim in the custom authorization server. This article is a guide through the process.

 

 

Applies To
  • ID/Access token
  • Claims
Cause

user.countryCode == null ? "en_US" : user.countryCode is set as the mapping expression for locale in the user's profile, which will cause the locale attribute to be en_US.

mapping 

Solution

This can be solved as follows:

  1. Go to Directory > Profile Editor > choose the app > click on Mappings > select Okta User to "DesiredAppName" > select the locale field.

The following expression should be in here:
 

user.countryCode == null ? "en_US" : user.countryCode


Change that to: 

  • user.locale


Scroll below and enter the user for preview. If the updated locale attribute is seen, then click on Save Mappings.

Mapping 

  1. Go to Security > API > choose the custom authorization server > Claims. Add the custom claim so that the locale info is included in the ID/Access token.

Add custom claim 

Now, if a request to the /userinfo endpoint is made, the locale custom claim should be included and updated in the tokens.

Loading
Updated "Locale" Value Not Reflected in ID/Access Tokens