Expand my Community achievements bar.

SOLVED

Authenticate salesforce user name and password from CQ

Avatar

Level 3

Hi,  I want to authenticate Salesforce user credential from CQ using API.

Can you please give me any example or steps to do it? I searched api and found com.adobe.cq.mcm.salesforceSalesforceSecretServlet.  It says: The SalesforceSecretServlet connects to the specified Salesforce instance and validates the request. It seems I need to override the doGet() method. However I am not getting how to pass salesforce user name and password to authenticate using this API.

My requirement is to first authenticate a given salesforce user in in CQ code and once authenticated, then access logged in user's data from salesforce into CQ. I got this url online but this is thru AEM console for a given user. I want to do it thru backend code.

http://docs.adobe.com/docs/en/aem/6-0/administer/integration/third-party-services/salesforce.html

Please suggest.

Thanks,

1 Accepted Solution

Avatar

Correct answer by
Level 10
3 Replies

Avatar

Correct answer by
Level 10

You can use OAuth Rest API to authenticate Salesforce users. Refer this

https://www.salesforce.com/us/developer/docs/api_rest/Content/quickstart_oauth.htm

Avatar

Level 10

To do this from backend code (OSGi bundle)- you will have to bundle the Sales Force API in a custom OSGi bundle and write a custom AEM service that uses the sales force API. Then the custom AEM service can make use of the public facing methods exposed by the Sales Force API.

You need to do these tasks:

1 - bundle up the Sales Force API in an OSGi bundle deploy and activate. More info about their Java API: https://developer.salesforce.com/page/Java

2 - write a AEM custom service that uses these APIs to perform Sales Force tasks. 

Therefore bundle 1 is the OSGi bundle that exposes the APIs and bundle 2 is the service that expose the operations to interact with Sales Force.  

Avatar

Level 10

If we use the REST API,  then we can avoid the salesforce API bundle