function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Andreas H.Andreas H. 

How to authenticate as an external app in SF to make changes to objects of a SF user

I'm all new to the Salesforce platform, so please excuse me not having a good understanding of it yet.

I want to know how authentication is supposed to work.

Let's assume that I want to integrate my external workflow software with Salesforce.

User X is a Salesforce user interacting with company A hosting my workflow software.

At some point, my workflow software has to reach out to Salesforce and update a Salesforce object (e.g. a contact) owned by User X.

Of course, my workflow software does not have/store any login credentials of User X.

How would my workflow software authenticate in Salesforce in order to update the status of a Salesforce object owned by User X?

Does User X need to do anything to expose her objects to my workflow software so it is able to make changes?

Again, I'm not impersonating User X but I rather simply want to make status updates to her objects. So which credentials do I provide in order to gain access to her objects?
shillyershillyer
Typically, partners who want to use the Force.com Web Services API to update Salesforce from an external app either use:
1. login() call
 
The login() call is more of a push approach that requires you to store the username/password. In your example, you probably want to use "User X" credentials so you have appropriate read/write access to her data. To make this more generic, you can use getUserInfo() to know who just logged, so you adhere to that particular Salesforce user's privileges.
 
Using the sessionId is more of pull approach. This integration should begin inside Salesforce and makes a call to your external app passing the current sessionId. You can then log back into the API with that sessionId and perform the necessary changes as that particular user. Check out this article for more details.
 
Hope that helps,
Sati