Access User Profiles
Learn how to access User Profiles
To access any of the applications in your Authgear account, each user must have a profile in the account. User Profiles contain information about your users such as name, contact information, and standard and custom attributes you define. You can retrieve and manage user profiles in the following ways:
Profile Attribute Access Rights
Every profile attribute has three access rights, one for each party that can reach it. You set them per attribute from User Profile > Standard Attributes or User Profile > Custom Attributes in the Authgear Portal.
Portal Admin Access Right
Admins using the Authgear Portal
User Management > a user > Profile tab
Token Bearer Access Right
Any client holding the user's access token
The UserInfo endpoint, including the SDK fetch user info function
Each access right is one of three levels:
Editable
Can view and change the attribute
Not available. The UserInfo endpoint is read-only.
Read-only
Can view but not change
Attribute is included in the UserInfo response
Hidden
Attribute is not shown
Attribute is omitted from the UserInfo response
Example

In this screenshot, Primary Email is Editable for Portal Admin, Read-only for Token Bearer and Editable for End-user. An admin can change it in the Portal, your app can read it from the UserInfo endpoint, and the user can change it on the User Settings page. Name is Hidden in all three columns, so nobody sees it until you change the setting.
Allowed combinations
The Portal enforces two rules:
An admin always has at least as much access as the other two parties.
If end-users can see an attribute, token bearers can see it too.
Token Bearer can only be Hidden or Read-only. If a change would break a rule, the Portal adjusts the other columns to match and asks you to confirm before saving.
Defaults
Authgear ships default access rights for every standard attribute. You can see and change them on the Standard Attributes page. Custom attributes get their access rights when you create them on the Custom Attributes page.
How to Retrieve and Manage User Profiles
Prerequisites
An Authgear account: You need an Authgear account to follow this guide. If you don't have one, you can create it for free on the Authgear website.
A Registered App: You need a registered application (client) in Authgear.
1. Access user profiles from the Authgear UI portal
It is the fastest and easiest way to view user profiles and manage them.
2. Access user profiles from apps using Authgear SDKs
Once Authgear completes authentication and returns control to your application, it provides the user profile to the application. Most developers prefer to use the Authgear SDKs to get the UserInfo object using the fetch user info function. To start using this function read getting started guides relevant to the SDK of your choice. Here are some code snippets that call the fetch user info function for different Authgear SDKs:
3. Access user profiles from Admin API
Authgear provides an Admin API GraphQL endpoint that allows applications and services to access and manipulate the User Profile object. The API Explorer lets users interactively explore the Admin API. With the API Explorer, you can search for users' profiles or update their standard or custom attributes. See the example steps of how to achieve this below:
4. Access user profiles from the OIDC UserInfo endpoint
The OpenID Connect (OIDC) UseInfo endpoint is a protected resource that provides information about a user when a service provider presents an access token that has been issued by your Authgear Token endpoint. The scopes in the access token specify the user attributes that are returned in the response of the user info endpoint. It is important to note that the openid scope must be one of the access token claims.
UserInfo Endpoint
The UserInfo endpoint returns the Claims about the authenticated end-user, including the standard profile and custom attributes.
The userInfo object is returned from calling fetch user info function which contains a unique identifier of the user.
The following are some attributes that are usually in the userInfo object. Other attributes like email, phoneNumber and custom attributes will be in the userInfo object if those attributes were set for the current user.
isVerified
boolean
Indicate if the user completed the verification requirement
sub
string
Unique identifier of the user in your Authgear project
To access a user's profile using the UserInfo endpoint of OpenID Connect, you need to follow these steps:
See a detailed explanation of the structure and fields included in the response of the UserInfo endpoint here.
5. Embed User Profiles into the JWT Access Token
Authgear WebHooks makes it possible to embed the standard attributes and custom attributes for a user's profile into the OIDC JSON Web Token (JWT). Hence, you access both profile attributes in the JWT returned to your OIDC client without making another call to the UserInfo endpoint.
See our post about how to Add custom fields to a JWT Access Token to learn more.
Last updated
Was this helpful?





