Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dcc2904
Contributor
Contributor

Salesforce Mutual Authentication Example(s)

Does anyone have any examples of how to setup Mutual Authentication on Salesforce and Talend?

It's basically a follow-up question from this old post:

https://community.talend.com/t5/Design-and-Development/resolved-tSalesforceConnection-secured-connec...

 

I need to establish a secure connection between the Talend job and Salesforce, and these are the components I'm using:

- tSalesforceConnection

- tSetKeystore

- tJava

- tSalesforceInput

 

I can establish a connection to Salesforce without any problems, and the tSetKeystore component seems to set correctly the Mutual Authentication certificate (because I don't get any errors in that part of execution, and I check for the existence of both Truststore ".crt" file and Keystore ".jks" file).  I've also implemented a tJava component to change the URL of the tSalesforceConnection to use port 8443 after the initial connection has been established.  It's only when the process gets to the tSalesforceInput that the job fails with the following error:

 

 

<exceptionCode>InvalidSessionId</exceptionCode>
<exceptionMessage>This session could not be mutually authenticated for use with the API</exceptionMessage>

 

 

The entire job is outlined here:

 

0683p000009Lqy4.jpgMutual Authentication Talend Job

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The code that is worth mentioning is the "change port" component:

 

org.talend.components.salesforce.SalesforceConnectionProperties props_tSalesforceConnection_1 =
(org.talend.components.salesforce.SalesforceConnectionProperties) globalMap.get("tSalesforceConnection_1_COMPONENT_RUNTIME_PROPERTIES"); props_tSalesforceConnection_1.setValue("endpoint", context.endpoint_8443); globalMap.put("tSalesforceConnection_1_COMPONENT_RUNTIME_PROPERTIES", props_tSalesforceConnection_1);

where "context.endpoint_8443" is a reference to:

https://test.salesforce.com:8443/services/Soap/u/39.0

 

 

 

Any ideas how to fix this?  Greatly appreciated.

 

Thanks.

Labels (5)
9 Replies
Sid3
Contributor III
Contributor III

Hi,

 

Can you please provide the screenshot of tSalesforceInput property? in this are you using the existing connection or modified values in your tJava component?

 

 

 

 

 

dcc2904
Contributor
Contributor
Author

Hi Sid.

 

Here's the tSalesforceInput component:

 

0683p000009Lqo6.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Notice that the tJava component is the third in the execution list.  That's where the example source code sits from the example I originally posted.  The screenshot here is for the tSalesforceInput parameters.  To answer your question: both....

I am using the existing connection called "con_bulk" but as far as I know, I modified the endpoint after the initial login to use port 8443.  So this component should be using the modified port information set in the tJava component.  It may be that the line:

 

props_tSalesforceConnection_1.setValue("endpoint", context.endpoint_8443);

Did not do its' job correctly?

 

Thanks for checking.

TRF
Champion II
Champion II

Not sure you're able to change the endpoint after the connection has been established.
dcc2904
Contributor
Contributor
Author

How come it was done as documented here?

https://community.talend.com/t5/Design-and-Development/resolved-tSalesforceConnection-secured-connec...

 

That's why I'm going initially with this approach.  Do you mean that I first should run the tJava to modify the endpoint URL, and then connect to SF?

That would be the same thing as putting the URL endpoint using the port as :8443 directly in the enpoint string parameter in the "tSalesforceConnection" component, correct?

TRF
Champion II
Champion II

I think so.
poojitha619
Contributor
Contributor

Hi..Is This issue resolved? I am also trying to do similar to your job
poojitha619
Contributor
Contributor

Hi..Is This issue resolved? I am also trying to do similar to your job
dcc2904
Contributor
Contributor
Author

Hi 

I stopped trying to implement this a while back.  I did not find a way to get it working and there was no useful documentation available.  If you find a way to get this working, please post it here if possible.

Thanks.

dcc2904
Contributor
Contributor
Author

Hi 

I stopped trying to implement this a while back.  I did not find a way to get it working and there was no useful documentation available.  If you find a way to get this working, please post it here if possible.

Thanks.