Contact Us 1-800-596-4880

Salesforce Connector 12.1 Additional Configuration Information

Configure Anypoint Connector for Salesforce (Salesforce Connector) to:

  • Load data in batches

  • Specify a Lead ID for a Lead Convert Request operation

  • Update field values to null

  • Generate an OAuth 2.0 keystore file

  • Invoke an APEX Rest method

  • Migrate from deprecated authentication

Load Data in Batches

The Salesforce Bulk API loads batches of your organization’s data into Salesforce. Salesforce Connector provides the Create and Create Bulk operations for working with the Bulk API.

For all bulk operations, Salesforce handles the creation process in the background. The connector replies with a BatchInfo object, which contains the ID of the batch and the ID of the job it creates to upload the batched objects.

In Salesforce, you can track the status of bulk data load jobs and their associated batches by using the job ID for Bulk Data Load Jobs:

  1. Click <YOUR_NAME > Setup > Monitoring > Bulk Data Load Jobs.

  2. Click the job ID to view the job detail page.

The job detail page includes a list of all the batches related to the job. The list provides View Request and View Response links for each batch. If the batch is a CSV file, the links return the request or response in CSV format. If the batch is an XML file, the links return the request or response in XML format.

Specify a Lead Convert Request ID

To specify a lead ID for a LeadConvertRequest operation, use a DataWeave transform message. When you use a transform message before the operation, you must add the leadId field, because the metadata for the operation doesn’t specify it:

<ee:transform doc:name="Transform Message" >
            <ee:message >
                <ee:set-payload ><![CDATA[%dw 2.0
output application/java
---
{
    leadId: "LEAD_ID",
    accountId: "ACCOUNT_ID",
    convertedStatus: "Closed - Converted",
    doNotCreateOpportunity: true
} as Object {
    class : "org.mule.extension.salesforce.api.core.LeadConvertRequest"
}]]></ee:set-payload>
            </ee:message>
</ee:transform>

Update Field Values to Null

To set field values to null, use an Update or Upsert request operation and insert the names of the fields you want to nullify in the Transform Message component’s fieldsToNull field:

Transform Message properties window for setting a field to null
Figure 1. Specify the field names you want to nullify in the Transform Message component fieldsToNull field.

Generate a Keystore File

Salesforce Connector uses the Bouncy Castle cryptographic library to load the certificate from the keystore and sign the payload for the authentication requests.

The library has a vulnerability (CVE-2018-5382) that relates to the BKS-V1 keystore file type. By default, Salesforce Connector uses JKS or PKCS12 keystores. Avoid using BKS-V1 keystore files, as documented in the Bouncy Castle proposed solution.

To generate a JKS keystore file:

  1. Go to your Mule workspace and open the command prompt (for Windows) or Terminal (for Mac).

  2. Enter this command:

    keytool -genkeypair -alias salesforce-cert -keyalg RSA -keystore salesforce-cert.jks
  3. Enter the following information:

    • Password for the keystore

    • Your first name and last name

    • Your organization unit

    • Your city and state, and the two-letter code for your country

      The system generates a Java keystore file (JKS format) that contains a private or public key pair in your workspace.

  4. Provide the file path for the keystore in your connector configuration.

    Enter this command:

    keytool -exportcert -alias salesforce-cert -file salesforce-cert.crt -keystore salesforce-cert.jks

    The system exports the public key from the keystore into the workspace. This is the public key to enter in your Salesforce instance.

  5. Verify that you have both the keystore (salesforce-cert.jks) and the public key (salesforce-cert.crt) files in your workspace.

Invoke APEX Rest Method

The Invoke APEX Rest operation enables users to invoke a method from an Apex class that is exposed as a REST service. The following example shows a payload for this operation:

<ee:transform doc:name="Transform Message">
			<ee:message >
				<ee:set-payload ><![CDATA[output application/java
---
{
	body: {
		URLParameters: {
			Parameter1: "parameter1Value",
			Parameter2: "parameter2Value"
		},
		account: {
			Name: "Example",
			AccountNumber: "55"
		}
	},
	headers: {
		header1:"header1Value"
	},
	cookies: {
		cookie1:"cookie1Value"
	},
	queryParameters: {
		queryParam1Name:"queryParam1Value",
		queryParam2Name:"queryParam2Value"
	}
}]]></ee:set-payload>
			</ee:message>
		</ee:transform>

In this example:

  • The body element contains URLParameters, which is a map containing the parameters that replace the wildcards in the path of the REST resource described in the Apex class.

    For example, if the REST resource is set to @RestResource(urlMapping='/myResource/*/mySubResource/*'), the value of Parameter1 replaces the first *, and the value of Parameter2 replaces the second *.

  • Key names must start with Parameter, followed by a number that shows the position of the * to be replaced.

  • After the URLParameters block, provide the content of the body value to send to the REST resource, as shown in the example account block.

  • The headers and cookies fields describe the headers and cookies to pass along with the HTTP request to the desired service.

  • The queryParameters field describes the query parameters to use, and the keys and values in this map that the specified Apex Class must accept.

Migrate from Deprecated Authentication

Salesforce is retiring authentication methods that existing Mule apps use with Salesforce Connector. Move those apps to a supported OAuth connection before the retirement date so the integration keeps running.

Retirement Dates

  • OAuth 2.0 username-password flow. Salesforce stops supporting this flow for connected apps on February 20, 2027. Salesforce first scheduled this retirement for the Winter '27 release, then moved enforcement to February 20, 2027. Orgs created in Summer '26 and later already block the flow. Salesforce Connector 11.x exposes this flow as the OAuth Username Password connection type. Salesforce Connector 12.x removes that connection type, and apps that still use it fail to deploy. For Salesforce’s announcement, see Retirement of OAuth 2.0 Username-Password Flow.

  • SOAP API login(). Salesforce retires login() in API versions 31.0 through 64.0 in the Summer '27 release. API version 65.0 and later don’t include login(). Salesforce Connector Basic Authentication calls this operation, and that connection remains available only for Salesforce API v64.0 and earlier. For Salesforce’s announcement, see Platform SOAP API login() Retirement.

Earlier SOAP login() restrictions can also cause failures before Summer '27. Starting December 1, 2026, login() succeeds only when the user has the Use Any API Auth permission. A broad login IP range also requires a security token. Treat those changes as interim controls. The durable fix is to migrate the connection to OAuth.

Choose a Replacement Connection

Use OAuth JWT for long-term, unattended Mule apps. The app signs a certificate instead of sending a user password or a client secret. Use OAuth Client Credentials when you want a simpler server-to-server setup with a client ID and client secret. Use OAuth SAML when the app signs a SAML 2.0 assertion and Salesforce is the identity provider. Use OAuth v2.0 when a person must sign in and approve access. That connection uses the authorization code grant.

Current connection Replace it with

OAuth Username Password

OAuth JWT (recommended), OAuth Client Credentials, OAuth SAML, or OAuth v2.0

Basic Authentication (SOAP login())

OAuth JWT (recommended), OAuth Client Credentials, or OAuth SAML

You don’t have to change Salesforce operations in the flow. Query, create, update, and the other operations keep the same configuration. Change only the connection type on the global element.

Before You Begin

  1. In Salesforce Setup, create an external client app or a connected app, and enable the OAuth flow you selected.

  2. For OAuth JWT, create a keystore and upload the certificate to the app. The connector signs the token with the SHA256withRSA algorithm. See Generate a Keystore File.

  3. For OAuth Client Credentials, enable the client credentials flow and assign the integration user that the app runs as.

  4. For OAuth SAML, enable Salesforce as a SAML identity provider and upload the certificate that signs the assertion. See OAuth SAML.

  5. For OAuth v2.0, register the callback URL that matches the listener path in the Mule app.

  6. Store the consumer key, client secret, and keystore password in a secure properties file.

  7. Confirm that the integration user can access the Salesforce objects the flow uses.

Migrate from OAuth Username Password

Follow these steps in a Salesforce Connector 11.x project. Version 12.x no longer lists OAuth Username Password, so change the connection before you upgrade.

  1. Open the Mule project in Anypoint Studio.

  2. Select a Salesforce operation and open its global element.

  3. On the General tab, change Connection from OAuth Username Password to OAuth JWT.

  4. Enter Consumer Key, Key Store, Store Password, Certificate Alias, and Principal. Principal is the Salesforce username that the token acts for. For each field, see OAuth JWT.

  5. Set Token Endpoint to the OAuth token URL for the org, such as https://login.salesforce.com/services/oauth2/token for production or https://test.salesforce.com/services/oauth2/token for a sandbox.

  6. Click Test Connection, and then redeploy the app.

This example shows an OAuth JWT connection:

<salesforce:sfdc-config name="Salesforce_Config" doc:name="Salesforce Config">
    <salesforce:jwt-connection
        consumerKey="${salesforce.consumerKey}"
        keyStore="${salesforce.keystore}"
        storePassword="${salesforce.keystore.password}"
        certificateAlias="${salesforce.certificate.alias}"
        principal="${salesforce.username}"
        tokenEndpoint="https://login.salesforce.com/services/oauth2/token"/>
</salesforce:sfdc-config>

To use client credentials instead, select OAuth Client Credentials and provide the client ID, client secret, and token URL. Replace mydomain with your Salesforce My Domain name. For each field, see OAuth Client Credentials.

<salesforce:sfdc-config name="Salesforce_Config" doc:name="Salesforce Config">
    <salesforce:oauth-client-credentials-connection
        clientId="${salesforce.clientId}"
        clientSecret="${salesforce.clientSecret}"
        tokenUrl="https://mydomain.my.salesforce.com/services/oauth2/token"/>
</salesforce:sfdc-config>

When a user must sign in, select OAuth v2.0 and configure the consumer key, consumer secret, and callback listener. For each field, see OAuth v2.0.

<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config">
    <http:listener-connection host="0.0.0.0" port="8081"/>
</http:listener-config>
<salesforce:sfdc-config name="Salesforce_Config" doc:name="Salesforce Config">
    <salesforce:config-with-oauth-connection
        consumerKey="${salesforce.consumerKey}"
        consumerSecret="${salesforce.consumerSecret}">
        <salesforce:oauth-callback-config
            listenerConfig="HTTP_Listener_config"
            callbackPath="/callback"
            authorizePath="/authorize"/>
    </salesforce:config-with-oauth-connection>
</salesforce:sfdc-config>

After you deploy the app, open the authorize path in a browser and complete the sign-in. The connector stores the access token for later requests.

To use a signed SAML assertion instead, select OAuth SAML and provide the consumer key, keystore, store password, and principal. Salesforce must be the identity provider. For each field, see OAuth SAML.

Migrate from Basic Authentication (SOAP login())

Basic Authentication sends the username and password to the SOAP login() endpoint. The Authorization URL points at that endpoint, for example https://login.salesforce.com/services/Soap/u/64.0.

  1. Open the Salesforce global element.

  2. On the General tab, change Connection from Basic Authentication to OAuth JWT.

  3. Enter the OAuth JWT fields described in OAuth JWT.

  4. Remove the username, password, and security token from the connection. Put the integration user’s username in Principal. The signed certificate replaces the password.

  5. If Authorization URL is set to a SOAP login URL, clear that value. OAuth JWT uses Token Endpoint instead.

  6. Click Test Connection, and then redeploy the app.

Connector Updates

Connector version What to change

11.x

Change OAuth Username Password or Basic Authentication to OAuth JWT, or to another supported OAuth connection, and test the app on 11.x.

12.x

OAuth Username Password is removed. Migrate that connection before you upgrade, or the app fails to deploy on 12.0.0. Basic Authentication works only with Salesforce API v64.0 and earlier. Migrate it before the Summer '27 retirement. See Upgrading and Migrating Salesforce Connector to 12.x.