Scenario: Using OAuth2 to log in to Salesforce.com - 6.1

Talend Components Reference Guide

EnrichVersion
6.1
EnrichProdName
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
task
Data Governance
Data Quality and Preparation
Design and Development
EnrichPlatform
Talend Studio

In this scenario, the OAuth2 (Open Authorization 2.0) method is adopted to authorize tSalesforceConnection to access the Salesforce.com resources. This way, better security is achieved as users do not need entering their Salesforce username/password directly on tSalesforceConnection, which is required by the Basic login type instead.

Linking the components

  1. Drop tSalesforceConnection, tFixedFlowInput and tSalesforceOutput onto the workspace.

  2. Link tSalesforceConnection to tFixedFlowInput using the OnSubjobOk trigger.

  3. Link tFixedFlowInput to tSalesforceOutput using a Row > Main connection.

Configuring the components

  1. Double-click tSalesforceConnection to open its Basic settings view.

  2. In the Login Type list, select OAuth2.

  3. In the Consumer Key and Consumer Secret fields, enter the relevant information.

  4. Double-click tFixedFlowInput to open its Basic settings view.

    Select Use Inline Content (delimited file) in the Mode area.

  5. In the Content field, enter the data to write to the Saleforce.com, for example:

    Talend
  6. Double-click tSalesforceOutput to open its Basic settings view.

  7. Select the Use an existing connection option.

  8. In the Action list, select insert to insert the account name Talend.

  9. In the Module list, select Account.

  10. Click the Edit schema button to open the schema editor.

  11. In the right panel, remove all the columns except Name.

  12. Click to copy the column Name from right to left.

  13. Click OK to validate the setup and close the editor.

Executing the Job

  1. Press Ctrl + S to save the Job.

  2. Press F6 to run the Job. The Studio console gives the url (in yellow) for OAuth authorization.

  3. Copy the url to the browser's address bar. The Salesforce.com login page appears.

  4. Fill up the username and password and click Log in to Salesforce.

    The authorization response is then shown on the browser at the callback host.

  5. Now is the time for the sub-job to run.

    As shown above, the Job is successfully executed.

  6. Go to the Salesforce.com and check the Account module. We can find that the account name Talend is inserted.