Get User Information
Learn how to get a user's profile information after signing in to an application.
We'll cover the following
When a user signs in, Okta sends their profile information back to the application. We can use this information to update the UI of our application according to our authorization protocols. The profile items returned by Okta are called claims. By default, Okta returns the user’s email address, first name, and last name. If we want to, we can also customize the items that are returned by Okta.
How to get a user’s profile information
We can get a user’s profile information using the getUserInfo()
method of the oktaAuth
object when the authState.isAuthenticated
flag is true
. The authState
and oktaAuth
are returned by the useOktaAuth
hook.
Get hands-on with 1400+ tech skills courses.