<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
0D54z00008FX396CADOkta Classic EngineAuthenticationAnswered2022-10-22T00:04:48.000Z2022-10-21T16:55:51.000Z2022-10-22T00:04:48.000Z

BrianT.46492 (Colorado General Assembly) asked a question.

The userNameAttributeName being passed from Okta is "sub" instead of "name"

We are integrating okta with a custom Spring application using OIDC. Okta sets the userNameAttibuteName to "sub" when authenticating; therefore, when we call authentication.getName() on the Oauth2 token, we get the actor id instead of the actual name of the user. Is there a way to override this to use the actual "name" attribute as opposed to the "sub" attribute?


  • User16594883467582706479 (Customer Support Online Experience)

    Hi, @BrianT.46492 (Colorado General Assembly)​ 

     

    Thank you for posting on our Community page!

     

    My advice would be to leverage the Okta Developer forums for this type of questions and take advantage of their expertise.

    https://devforum.okta.com/

     

    Thank you for reaching out to our Community and have a great day!

     

    _____________________________________________________________________________

    The October issue of the Okta Community is here and packed with tips on certification, how to earn badges, and new releases. Let us help you stay connected.

    _____________________________________________________________________________

    If my answer helped, remember to select it as best to increase its visibility for other members of the Okta Community who might have the same questions as you. 

    _____________________________________________________________________________

     

    Expand Post
This question is closed.
Loading
The userNameAttributeName being passed from Okta is "sub" instead of "name"