Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Salesforce Connected App OAuth Process in Hybrid Mobile Application

I have created a hybrid mobile application using Salesforce Ionic starter app from this url: http://coenraets.org/blog/cordova-phonegap-3-tutorial/.

I am facing a problem, that every time a user logs in he has to allow the connected app. I think it should be only once that the user should Allow and for his subsequent logins he should be given the access normally as done with Facebook or Twitter OAuth.

I think I am not setting some parameter or making some call properly.

I am using the ForceJS SDK and calling the force.init to initialise it. It automatically calls the custom salesforce oauth plugin for cordova. Please help.

like image 338
Rahat Khanna Avatar asked Oct 20 '22 21:10

Rahat Khanna


1 Answers

Generally speaking (I'm not familiar with SalesForce mobile dev) if you are using the SDK provided correctly (seemed hard to misuse, only it didn't support the latest Cordova versions?) it should keep the app allowed. That indicates that the problem is with your SalesForce settings.

Inside SalesForce, go to

Setup | Administration Setup | Manage Apps | Connected Apps

and have a look at

Require Users to Log In

option. Is it set so that users only need to log in the first time they use the app, and the permissions are maintained?

If that doesn't help, try out the settings described here here, especially the refresh token part.

like image 113
Roope Hakulinen Avatar answered Oct 22 '22 14:10

Roope Hakulinen