ThirdPartyAccountLink

Represents the list of external users who authenticated using an Auth. Provider. This object is available in API version 32.0 and later.

A list of third-party account links is generated when users of an organization authenticate using an external Auth. Provider. Use this object to list and revoke a given user's social sign-on connections (such as Facebook©).

Supported Calls

describeSObjects()query()

Fields

Field Name Details
Handle
Type
string
Properties
Filter, Nillable, Sort
Description
The username in the third-party system.
IsNotSsoUsable
Type
boolean
Properties
Defaulted on create, Filter, Group, Sort
Description
Support for single sign-on.

If true, the link cannot be used for a single sign-on flow. It is only available OAuth access and refresh tokens.

Provider
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The third-party account provider name.
RemoteIdentifier
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The unique ID for the user in the third-party system.
SsoProvider
Type
AuthProvider
Properties
Filter, Group, Nillable, Sort
Description
The foreign key to the AuthProvider of the third-party system.
SsoProviderId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The ID associated with the SsoProvider value.
SsoProviderName
Type
string
Properties
Filter, Group, Nillable, Sort
Description
The name associated with the AuthProvider of the third-party system, in case the user has no access to the provider foreign key (the SsoProvider value).
ThirdPartyAccountLinkKey
Type
string
Properties
Filter, Group, Nillable, Sort
Description
A concatenated string including the organization ID, the SsoProviderId value, the SsoProvider value, and the RemoteIdentifier value.
UserId
Type
reference
Properties
Filter, Group, Nillable, Sort
Description
The Salesforce user associated with this third-party account link.

Usage

Administrators (with the “Manage Users” permission) querying this object can see all the links for all users in the organization. Without the “Manage Users” permission, users can only retrieve their own links. A user might not have access to the SsoProvider value (the foreign key). In this case, use the SsoProviderName to render the name of the provider for the associated link.

Use the Apex method Auth.AuthToken.revokeAccess() to revoke a link.

To make the ThirdPartyAccountLink standard object writable for Salesforce admins, contact Salesforce Customer Support. With this feature, you can easily add or delete third-party account links using the API, but you can’t update existing account links.

In API version 34.0 and later, this object was enhanced to help manage high instance counts. A query() call returns up to 500 rows. A queryMore() call returns 500 more, up to 2500 total. No more records are returned after 2500. To make sure that you don’t miss any records, issue a COUNT() query in a SELECT clause for ThirdPartyAccountLink. This query gives you the total number of records. If there are more than 2500 records, divide your query by filtering on fields, like UserId, to return subsets of less than 2500 records.