Five Stars

Automatic Authorization using Oauth in Salesforce

Hi All, Need help in establishing connection to Salesforce using Oauth. Once connection is established, I need to retrieve certain filed values from multiple objects and do certain manipulation(Calculation) and load it back to Salesforce.

 

For this I tried to design a Talend Jobs but no luck:

 

 

Capture1.PNG

 

Untitled1.png

 

Capture2.PNGCapture3.PNGUntitled2.png

In TJavaRow__1, we are geeting access_token. But I dont Understand how do the connection established So that I can retrive Filed values form Multiple Object.

Please advice me on this. 

  • Talend Integration Cloud
Tags (1)
5 REPLIES
Six Stars

Re: Automatic Authorization using Oauth in Salesforce

Hi there!

What's the error you're getting from Salesforce?

 

What I usually do here is add the OAuth-Token as a header parameter for plus the token and it works fine.

Screen Shot 2017-07-18 at 15.04.28.png

Five Stars

Re: Automatic Authorization using Oauth in Salesforce

Hi douglaszickuhr   Thanks for quick reply. below is the same error I got even I tried the way you did:eror.png

It will we helpful for me if you give the steps you followed in order to establish the connection and to retrieve some of the objects filed values. 

 

Thanks for replying. 

Tags (1)
Six Stars

Re: Automatic Authorization using Oauth in Salesforce

Hello

 


mitesh089 wrote:

Hi douglaszickuhr   Thanks for quick reply. below is the same error I got even I tried the way you did:eror.png

It will we helpful for me if you give the steps you followed in order to establish the connection and to retrieve some of the objects filed values. 

 

Thanks for replying. 


First step is request the token from your server. After that, just save it on your globalMap. You need to make sure you're extracting just the token String. It seems on your screenshow you're printing a JSON.

Screen Shot 2017-07-19 at 10.01.55.png

 

 

 

I found some information on Internet about how to set the connection to Salesforce:

//set the token in the header
 gm.setRequestHeader("Authorization", "Bearer "+accessToken);

What you need to do is something like that:

Screen Shot 2017-07-19 at 10.01.14.png

 

Please, try that and make sure that nobody is accessing the target software with the same user as you're using on Talend.

Five Stars

Re: Automatic Authorization using Oauth in Salesforce

Hi douglaszickuhr, I'm already getting Token like "00D3EB009508zmi!ARoAIFMBtJFr2CQ2SLGyNBt_eyBBlWFEQolWId0Ycl.CZP9b3qaw46AxbmQiv0ISmnEUKFHy78_iazG3fQ8eAj38bybci3II"

Is this not correct Format?

Once you get token then how to get salesforce connection. Please let me know if some thing I'm missing.

Tags (1)
Six Stars

Re: Automatic Authorization using Oauth in Salesforce

That should work.

In your tRestClient advanced options add the following header param:

Screen Shot 2017-07-19 at 11.30.00.png

Please reach me out on douglaszickuhr on Skype if you're not able to go ahead. It's a pleasure to help. Smiley Happy