Loading

Salesforce Connector Steps to Set Up Two-Way Mutual Authentication with Mulesoft

Date de publication: Apr 18, 2025
Tâche

GOAL

Accomplish two-way mutual authentication with Salesforce and Mulesoft.

Étapes
  • Enable Two-Way Mutual Authentication in Salesforce and Create a profile with Enforce SSL/TLS Mutual Authentication permission set to true.  Assign a user account to this profile.
  • Obtain Certificates. Please note that Salesforce does not allow using self-signed certs for Mutual Authentication, so a CA-signed cert is needed.

    Commands to generate private key and certificate signing request:

openssl genrsa -out private.pem 2048
openssl req -new -key private.pem -out mysignrequestfile.csr

               The certificate that needs to be uploaded is your public PEM-encoded certificate chain.

  • Generate a JKS to use in Mulesoft

               Mule's mutual authentication requires a JKS file to be created. This will be the concatenation of the private key and public cert.
               The following commands can be used to accomplish the task:

cat private.pem public.pem > clientCert.pem
openssl pkcs12 -export -in clientCert.pem -out cert.p12
keytool -importkeystore -srckeystore cert.p12 -srcstoretype pkcs12 -destkeystore clientCert.jks
  • Configure the Salesforce Connector in Mule

                  Import your JKS file into your resources folder, and use the following configuration for the Salesforce Connector. This should give a successful connection.

      Salesforce Connector configuration:

<salesforce:sfdc-config name="Salesforce_Config" doc:name="Salesforce Config" doc:id="9e5566a2-f167-4a27-aba5-394ad7b8e8a9" >
<salesforce:basic-connection username="auser@mulesoft.com" password="aPassword" securityToken="aSecToken" >
<tls:context >
<tls:key-store type="jks" path="clientCert.jks" alias="1" keyPassword="xxx" password="xxx" />
</tls:context>
</salesforce:basic-connection>
</salesforce:sfdc-config>


Refer to the Salesforce documentation.               
               Set Up Mutual Authentication Certificate
               Configure Your API Client to Use Mutual Authentication

 

Numéro d’article de la base de connaissances

001115543

 
Chargement
Salesforce Help | Article