UserData Class

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

Auth

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

The following are constructors for UserData.

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

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)

  • 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.

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.

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)

  • 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.

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.

  • firstName

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

  • lastName

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

  • fullName

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

  • email

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

  • link

    A stable link for the authenticated user such as https://www.facebook.com/MyUsername.

  • username

    The username of the authenticated user in the third party.

  • locale

    The standard locale string for the authenticated user.

  • provider

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

  • siteLoginUrl

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

  • 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.

  • 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.

  • 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.

  • 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.

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

public String identifier {get; set;}

Type: String

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

public String firstName {get; set;}

Type: String

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

public String lastName {get; set;}

Type: String

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

public String fullName {get; set;}

Type: String

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

public String email {get; set;}

Type: String

A stable link for the authenticated user such as https://www.facebook.com/MyUsername.

public String link {get; set;}

Type: String

The username of the authenticated user in the third party.

public String username {get; set;}

Type: String

The standard locale string for the authenticated user.

public String locale {get; set;}

Type: String

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

public String provider {get; set;}

Type: String

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

public String siteLoginUrl {get; set;}

Type: 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.

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

Type: Map<String, String>

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.

public String idToken {get; set;}

Type: String

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.

public String userInfoJSONString {get; set;}

Type: String

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.

public String idTokenJSONString {get; set;}

Type: String