[ReactJS] oktaAuth.token.getUserInfo returns limited set of user properties


I have a React single page app with Okta authentication. The authentication works properly, however, I cannot seem to get the user information I need to customize the application.

Once the user is authenticated, I’m using the oktaAuth.token.getUserInfo() method but it only returns the following user’s properties:

  • sub
  • email
  • email_verified

I’m trying to get the firstname (given_name) and lastname (family_name) of the user.

The oktaAuth instance has been configured with the following scopes:
openid, profile, email

Thanks for the help,

it’s happening b/c the information is pulled out of id_token. If you want the full profile you need to go to Okta /userinfo endpoint, or include few attributes into id_token as custom claims

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.