ConnectionParams Class

Contains the credentials for authenticating to the external system.

Namespace

DataSource

Usage

If your extension of the DataSource.Provider class returns DataSource.AuthenticationCapability values that indicate support for authentication, the DataSource.Connection class is instantiated with a DataSource.ConnectionParams instance in the constructor.

The authentication credentials in the DataSource.ConnectionParams instance depend on the Identity Type field of the external data source definition in Salesforce.
  • If Identity Type is set to Named Principal, the credentials come from the external data source definition.
  • If Identity Type is set to Per User:
    • For queries and searches, the credentials are specific to the current user who invokes the query or search. The credentials come from the user’s authentication settings for the external system.
    • For administrative connections, such as syncing the external system’s schema, the credentials come from the external data source definition.

The values in this class can appear in debug logs and can be accessed by users who have the “Author Apex” permission. If you require better security, we recommend that you specify named credentials instead of URLs as your Apex callout endpoints. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your code doesn’t have to.

ConnectionParams Properties

The following are properties for ConnectionParams.

certificateName

The name of the certificate for establishing each connection to the external system.

Signature

public String certificateName {get; set;}

Property Value

Type: String

The value comes from the external data source definition in Salesforce.

endpoint

The URL of the external system.

Signature

public String endpoint {get; set;}

Property Value

Type: String

The value comes from the external data source definition in Salesforce.

oauthToken

The OAuth token that’s issued by the external system.

Signature

public String oauthToken {get; set;}

Property Value

Type: String

password

The password for authenticating to the external system.

Signature

public String password {get; set;}

Property Value

Type: String

The value depends on the Identity Type field of the external data source definition in Salesforce.
  • If Identity Type is set to Named Principal, the credentials come from the external data source definition.
  • If Identity Type is set to Per User:
    • For queries and searches, the credentials are specific to the current user who invokes the query or search. The credentials come from the user’s authentication settings for the external system.
    • For administrative connections, such as syncing the external system’s schema, the credentials come from the external data source definition.

principalType

An instance of DataSource.IdentityType, which determines which set of credentials to use to access the external system.

Signature

public DataSource.IdentityType principalType {get; set;}

Property Value

Type: DataSource.IdentityType

protocol

The type of protocol that’s used to authenticate to the external system.

Signature

public DataSource.AuthenticationProtocol protocol {get; set;}

Property Value

Type: DataSource.AuthenticationProtocol

repository

Reserved for future use.

Signature

public String repository {get; set;}

Property Value

Type: String

Reserved for future use.

username

The username for authenticating to the external system.

Signature

public String username {get; set;}

Property Value

Type: String

The value depends on the Identity Type field of the external data source definition in Salesforce.
  • If Identity Type is set to Named Principal, the credentials come from the external data source definition.
  • If Identity Type is set to Per User:
    • For queries and searches, the credentials are specific to the current user who invokes the query or search. The credentials come from the user’s authentication settings for the external system.
    • For administrative connections, such as syncing the external system’s schema, the credentials come from the external data source definition.