Authenticate salesforce user name and password from CQ | Community
Skip to main content
MeenakshiP
New Participant
October 16, 2015
Solved

Authenticate salesforce user name and password from CQ

  • October 16, 2015
  • 3 replies
  • 628 views

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,

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Lokesh_Shivalingaiah

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

3 replies

Lokesh_Shivalingaiah
Lokesh_ShivalingaiahAccepted solution
New Participant
October 16, 2015

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

smacdonald2008
New Participant
October 16, 2015

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.  

Lokesh_Shivalingaiah
New Participant
October 16, 2015

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