---
schema_version: "1"
id: 932b4197c882ba1a0b1cfb8f8c4fd120977308e27d47ae741df041c004e0beaa
title: ConnectionParams Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_DataSource_ConnectionParams.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 189fbf0019cca24ab366670d4f62ebdd95087d66fbb1d1f9f7c4624f67745e09
description: Contains the credentials for authenticating to the external system.The name of the certificate for establishing each connection to the external system.The URL of the external system.The OAuth token that’s issued by the external system.The password for authenticating to the external system.An instance of DataSource.IdentityType, which determines which set of credentials to use to access the external system.The type of protocol that’s used to authenticate to the external system.Reserved for future use.The username for authenticating to the external system.
---
# ConnectionParams Class

Contains the credentials for authenticating to the external system.

## Namespace

[DataSource](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_DataSource.htm "The DataSource namespace provides the classes for the Apex Connector Framework. Use the Apex Connector Framework to develop a custom adapter for Salesforce Connect. Then connect your Salesforce organization to any data anywhere via the Salesforce Connect custom adapter.")

## Usage

If your extension of the [DataSource.Provider](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_class_DataSource_Provider.htm) class returns [DataSource.AuthenticationCapability](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_enum_DataSource_AuthenticationCapability.htm) values that indicate support for authentication, the [DataSource.Connection](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_class_DataSource_Connection.htm) class is instantiated with a [DataSource.ConnectionParams](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_class_DataSource_ConnectionParams.htm) 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_properties)**

## ConnectionParams Properties

The following are properties for ConnectionParams.

- **[certificateName](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_certificateName)**  
    The name of the certificate for establishing each connection to the external system.
- **[endpoint](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_endpoint)**  
    The URL of the external system.
- **[oauthToken](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_oauthToken)**  
    The OAuth token that’s issued by the external system.
- **[password](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_password)**  
    The password for authenticating to the external system.
- **[principalType](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_principalType)**  
    An instance of DataSource.IdentityType, which determines which set of credentials to use to access the external system.
- **[protocol](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_protocol)**  
    The type of protocol that’s used to authenticate to the external system.
- **[repository](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_repository)**  
    Reserved for future use.
- **[username](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_DataSource_ConnectionParams.htm#apex_DataSource_ConnectionParams_username)**  
    The username for authenticating to the external system.

### certificateName

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

#### Signature

public String certificateName {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

### password

The password for authenticating to the external system.

#### Signature

public String password {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_IdentityType.htm "Determines which set of credentials is used to authenticate to the external system."), 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_IdentityType.htm "Determines which set of credentials is used to authenticate to the external system.")

### 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](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_enum_DataSource_AuthenticationProtocol.htm "Determines what type of credentials are used to authenticate to the external system.")

### repository

Reserved for future use.

#### Signature

public String repository {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

Reserved for future use.

### username

The username for authenticating to the external system.

#### Signature

public String username {get; set;}

#### Property Value

Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.")

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.