3

I'm reading the force.com REST API guide, specifically, the area around authentication.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/intro_understanding_authentication.htm

Salesforce does not recommend using the username-password flow unless absolutely necessary.

My question is:

Is the username-password flow the only flow that will work if a backend process in my software needs to connect to Salesforce and pull data? With both the web server oauth and user agent oauth flow, it seems user interaction is required via a web interface.

  • I'm not sure you have any other options for SF. One way google handles this use case is by issuing a 1 time code that is given to the server application and then used to issue a refresh token. developers.google.com/identity/sign-in/web/server-side-flow I wish SF would implement something similar. – NSjonas Sep 1 '15 at 15:29
3

The OAuth 2.0 JWT Bearer Token flow is a good choice for server to server communication where you don't want any user interaction. The communication is secured via a pre-created certificate. Scroll down this Digging Deeper into OAuth 2.0 on Force.com article and you'll see this flow discussed.

There is sample Java code and sample Apex code available and you should be able to create a solution in other languages of your choice providing the necessary cryptography logic is available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.