I see from the following help page that it is possible to login as another user when in the Salesforce Web UI.

Salesforce help page: Logging in as another user

However I'm developing a mobile app and sometimes it would be really useful to login as another user through oauth and the mobile SDK. Is this possible? If so what's the easiest way? Thanks!


Short answer: no, it's not possible to login as another user via OAuth and the Mobile SDK.

The closest thing you could do would be to have your app request refresh_token scope (as well as whichever other scopes it needs); user A could then login and the app would pass user A's refresh token to user B, who would create an access token from it. The app should allow A or B to revoke the refresh token, particularly since they are a limited resource (5 per user per app).

Note - I haven't done any security analysis on the above. It allows user B to impersonate user A as far as the scope of the token allows. You should carefully consider if this is what you want.

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.