UserData Class

Stores user information for authentication provider registration handlers, including handlers that implement the Auth.RegistrationHandler interface and handlers built using Flow Builder.

Namespace

Auth

Usage

For more information about using this class with the Auth.RegistrationHandler interface, see Storing User Information and Getting Access Tokens in the RegistrationHandler Interface documentation.

For more information about using this class as an Apex-defined variable in a user registration flow, see Example: Authentication Provider Registration Handler Flow in Salesforce Help

UserData Constructors

The following are constructors for UserData.

UserData(identifier, firstName, lastName, fullName, email, link, userName, locale, provider, siteLoginUrl, attributeMap)

Creates a new instance of the Auth.UserData class using the specified arguments.

Signature

public UserData(String identifier, String firstName, String lastName, String fullName, String email, String link, String userName, String locale, String provider, String siteLoginUrl, Map<String,String> attributeMap)

Parameters

identifier
Type: String
An identifier from the third party for the authenticated user, such as the Facebook user number or the Salesforce user ID.
firstName
Type: String
The first name of the authenticated user, according to the third party.
lastName
Type: String
The last name of the authenticated user, according to the third party.
fullName
Type: String
The full name of the authenticated user, according to the third party.
email
Type: String
The email address of the authenticated user, according to the third party.
link
Type: String
A stable link for the authenticated user such as https://www.facebook.com/MyUsername.
userName
Type: String
The username of the authenticated user in the third party.
locale
Type: String
The standard locale string for the authenticated user.
provider
Type: String
The service used to log in, such as Facebook or Janrain.
siteLoginUrl
Type: String
The site login page URL passed in if used with a site; null otherwise.
attributeMap
Type: Map<String, String>
A map of data from the third party, in case the handler has to access non-standard values. For example, when using Janrain as a provider, the fields Janrain returns in its accessCredentials dictionary are placed into the attributeMap. These fields vary by provider.

UserData(identifier, firstName, lastName, fullName, email, link, username, locale, provider, siteLoginUrl, attributeMap, idToken, userInfoJSONString)

Creates an instance of the Auth.UserData class that includes the ID token and user info response from the identity provider, if returned during single sign-on.

Signature

public UserData(String identifier, String firstName, String lastName, String fullName, String email, String link, String username, String locale, String provider, String siteLoginUrl, Map<String,String> attributeMap, String idToken, String userInfoJSONString)

Parameters

identifier
Type: String
An identifier from the third party for the authenticated user, such as the Facebook user number or the Salesforce user ID.
firstName
Type: String
The first name of the authenticated user, according to the third party.
lastName
Type: String
The last name of the authenticated user, according to the third party.
fullName
Type: String
The full name of the authenticated user, according to the third party.
email
Type: String
The email address of the authenticated user, according to the third party.
link
Type: String
A stable link for the authenticated user such as https://www.facebook.com/MyUsername.
username
Type: String
The username of the authenticated user in the third party.
locale
Type: String
The standard locale string for the authenticated user.
provider
Type: String
The service used to log in, such as Facebook or Janrain.
siteLoginUrl
Type: String
The site login page URL passed in if used with a site; null otherwise.
attributeMap
Type: Map<String, String>
A map of data from the third party, in case the handler has to access non-standard values. For example, when using Janrain as a provider, the fields Janrain returns in its accessCredentials dictionary are placed into the attributeMap. These fields vary by provider.
idToken
Type: String
If provided by the third party, the ID token, formatted as an encoded JWT. The ID token contains claims with information about the authenticated user.
userInfoJSONString
Type: String
If provided by the third party, the user info response, formatted as a JSON object that has been serialized into a string.

UserData Properties

The following are properties for UserData.

identifier

An identifier from the third party for the authenticated user, such as the Facebook user number or the Salesforce user ID.

Signature

public String identifier {get; set;}

Property Value

Type: String

firstName

The first name of the authenticated user, according to the third party.

Signature

public String firstName {get; set;}

Property Value

Type: String

lastName

The last name of the authenticated user, according to the third party.

Signature

public String lastName {get; set;}

Property Value

Type: String

fullName

The full name of the authenticated user, according to the third party.

Signature

public String fullName {get; set;}

Property Value

Type: String

email

The email address of the authenticated user, according to the third party.

Signature

public String email {get; set;}

Property Value

Type: String

username

The username of the authenticated user in the third party.

Signature

public String username {get; set;}

Property Value

Type: String

locale

The standard locale string for the authenticated user.

Signature

public String locale {get; set;}

Property Value

Type: String

provider

The service used to log in, such as Facebook or Janrain.

Signature

public String provider {get; set;}

Property Value

Type: String

siteLoginUrl

The site login page URL passed in if used with a site; null otherwise.

Signature

public String siteLoginUrl {get; set;}

Property Value

Type: String

attributeMap

A map of data from the third party, in case the handler has to access non-standard values. For example, when using Janrain as a provider, the fields Janrain returns in its accessCredentials dictionary are placed into the attributeMap. These fields vary by provider.

Signature

public Map<String, String> attributeMap {get; set;}

Property Value

Type: Map<String, String>

idToken

If provided, the ID token from the third party, formatted as an encoded JWT. The ID token contains claims with information about the authenticated user.

Signature

public String idToken {get; set;}

Property Value

Type: String

userInfoJSONString

If provided, the user info response from the third party. The user info response is a JSON object containing user attributes. When used in this property, the JSON object is serialized into a string.

Signature

public String userInfoJSONString {get; set;}

Property Value

Type: String

idTokenJSONString

If provided, the ID token from the third party. The ID token is formatted as a JSON Web Token (JWT) containing claims with information about the user. When used in this property, the ID token is serialized into a string.

Signature

public String idTokenJSONString {get; set;}

Property Value

Type: String