So I'm logged in as "Amber," and I have privileges to log in as any user in the system. If I were to log in as "Jessica" and open the developer console, would I still be able to access information about the profile "Amber" with Apex code? Is there any class for this, or is all the information about the previous user you logged in from completely lost?

1 Answer 1


The Developer Console's API, like all other tools, is tied to a user's Session ID. So, when you log in as a separate user, the Developer Console would get that user's Session ID, and be restricted to that user's permission. This even includes logging in by way of the "Login Access" mechanism for administrators. This means the user you're logging in as would need to have at least View All Data to even load the console, and it would load their configuration (e.g. "Jessica") instead of the user you're logged in as (e.g. "Amber"). None of Amber's data would be visible to Jessica.

  • I noticed that when you are logged in as another user, you can't log in again as another user once more. In other words, you can't "double dip," so Salesforce can still recognize the difference between an impersonator and the real user even if all the information in the console and the org is shown with Jessica's configuration. Is there an Apex library that lets you distinguish if Jessica is an impersonator or a real user even if she can't access Amber's data?
    – cryptobox
    Commented Dec 5, 2017 at 16:57
  • @user2981945 No, it's intentionally meant to be indistinguishable at the API level, including the various API's (REST, SOAP) as well as in Apex Code. As far as the platform is concerned, you "are" that user.
    – sfdcfox
    Commented Dec 5, 2017 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .