Auth0 Normalized User Profile

Since every identity provider provides a different set of information about a user, Auth0 normalizes common profile properties in the User Profile.

For example, family_name in the User Profile contains details that may have been returned as surname or last_name.

Normalized User Profile Schema

The attributes that Auth0 maps to a common schema are listed below.

Fields that are always generated:

name: the user's full name.

nickname: the user's username.

picture: the URL of the user's picture. If unavailable, Auth0 uses the Gravatar image associated with the user's email address.

user_id: the user's unique identifier. This is unique per Connection, but the same for all apps that authenticate via that Connection.

Fields that are generated when the details are available:

email: the user's email address.

email_verified: a boolean indicating if the user's email address has been verified.

given_name: the user's first name.

family_name: the user's last name.

Additional Attributes

The User Profile includes an array of identities. In the most common case (logging in with a single provider), the array contains only one element. If the user has multiple accounts linked, the array will have an element for each associated account.

NOTE: Auth0 will pass to your app all other properties supplied by the identity provider, even if those that are not mapped to the standard attributes listed above.

Storing User Data

When outsourcing user authentication, there is usually no need to maintain your own users/passwords table. Even so, you may still want to associate application data to authenticated users.

For example, you could have a Users table that lists each user authenticated by Auth0. Every time a users logs in, you could search the table for that user. If the user does not exist, you would create a new record. If they do exist, you would update all fields, essentially keeping a local copy of all user data.

Alternatively, you could store the user identifier in each table/collection that has user-associated data. This is a simpler implementation suited to smaller applications.

Uniquely identify users

There are two recommended options to uniquely identify your users:

By the user_id property. This is guaranteed to be unique per user (e.g. {identity provider id}|{unique id in the provider}, or facebook|1234567890).

By a natural key, like the email property. In this case, it is recommended that you enable email verification and only use this option with providers that require that users verify their emails.

Sample User Profiles

This is a sample user profile from a user that logged in through Google: