Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have two connected apps in my developer org. One is for Android and other for iOS devices. What I want to know is why a user can have multiple login sessions in different devices (or same). Is there a way to not allow a user to login? For example in a Android device and then in a iOS device via connected app?

Another question. Everytime I login on my device app, SF always shows me the permissions page to Allow / Deny the app. Why does this happen? Is it because I didn't publish my connected app yet?

share|improve this question

2 Answers 2

In answer to your first question - you can control access to connected apps via profiles and permission sets. Go to Your Name | Manage Apps | Connected Apps and click on an app. From here you can change Permitted Users to Admin-approved Users, and add a permission set to each app. Now you can add users to the relevant permission set.

Salesforce shows the permissions page when you request OAuth authorization (user-agent flow). Your app should request a refresh token and save that (securely!) on the device. When your app starts it should check for the presence of a refresh token and use the token refresh flow to obtain a new access token, rather than the user-agent flow.

share|improve this answer
  1. Given user can be logged from up to 4 sources (browsers/apps) at same time, so I don't see any easy way to block user for logging from 2 apps at same time.

  2. Are you storing access token in apps? Remember that to be able to obtain token you need access code (which actually is short lived token).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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