in Education by
The Salesforce.com API seems to assume that you will always use the app as an active user. Their authentication methods (Session ID and OAuth) support this as they both require an authenticated user to "do something". What is the strategy for when you have a background app that needs access to the API? The examples that I have seen ask for your full credentials - user name, password, and security token. Not only do I not want to know or store that information, but it can change (from password policies, etc) and I'd rather not have the app break because of that. What is the "best practice" for long lived authentication to SFDCs APIs that does not require user interaction? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The SFDC API requests operate in the context of a user which is identified by a sessionId or access_token. So, to make API calls, sessionId is needed and you get that by storing the username/security token/password and by calling login whenever you need to. Also, you can achieve this by using the interactive OAuth flow which will require the user to authorize your application. At this point, you will be given a long-lasting token called the refresh token. After that, at any point, you can go ahead and use OAuth2 token service to get a new access_token by just using a refresh token. I guess this last approach will meet your needs, it's just that this would require one-time user interaction to originally sanction your application.

Related questions

0 votes
    The Salesforce.com API seems to assume that you will always use the app as an active user. Their ... require user interaction? Select the correct answer from above options...
asked Feb 5, 2022 in Education by JackTerrance
0 votes
    Friends, I have a contact us/Inquiry form in my website. I want to generate a lead in Sales force CRM on ... any link for API. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to update a record via the SalesForce API (Enterprise WSDL). The code below executes fine, and the ... updateParticipant }); if (result == null || result.Length...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Is there a way to determine if a trigger is being executed by an API call or through the Salesforce Web Interface ... updating to 26.0) Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I have recently discovered that salesforce.com is much more than an online CRM after coming across a Morrison's Case ... ' .Net route? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm trying to get an authorization token using the Username-Password flow (as described in the final section of this ... work for me. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    When using the SOAP API to work with salesforce.com (SFDC) it seems that the primary key in the underlying database ... is all about? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I am asking this in very general sense. Both from cloud provider and cloud consumer's perspective. Also the ... Server like Biztalk? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I would like to integrate SalesForce information into a .net MVC application. The samples on SalesForce website are ... .NET Thanks. Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm a little confused. We downloaded the WSDL file from Salesforce and created a web reference to it using a ... step? Any advice? Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    I'm trying to execute a SOQL query using Salesforce REST API which will return 2,749 results. However, it seems ... the REST API. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 28, 2022 in Education by JackTerrance
0 votes
    I am writing an API for an iOS app where the user's login with the Facebook API on iOS. The server ... achieve this kinda setup? Select the correct answer from above options...
asked Feb 3, 2022 in Education by JackTerrance
0 votes
    We're currently looking at using the Force.com platform as our development platform and the sales guys and the ... such a platform. Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I'm starting out with force.com development, and I'm currently a little hazy about what the above terms all mean. ... (if at all)? Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
...