I am the Admin of a dev system. I have created a VF Page and placed in standard page layout.

When I login as a specific user(has access to the VF Page) using Grant login access, I am receiving an insufficient privileges error on the VF Page and the login name inside the VF Page is showing My name(Admin).

When I refresh the page, the visualforce buttons are displayed.

Why is this happening?

Thank you in Advance for the responses.

3 Answers 3


Please check the CRUD's of all the objects being referenced in the VF/APEX if it is purely insufficient privileges error. Can post exact error message?

  • Rob, on refresh of page, the VF Buttons are appearing
    – Raja
    Commented Mar 13, 2014 at 9:58

Seems like an issue with the Salesforce Session Cookie. You could use something like the Chrome developer tools Network tab to inspect the cookies that are sent to the Visualforce page.

At a guess, your older Admin Session cookie is being sent with the first request. Once refreshed to correct use cookie is sent.

Another possiblity if you are using SAML SSO:
Insufficient Privileges when logged in as another user - Knowledge Article Number: 000175641


User has implemented a SAML SSO solution from Salesforce to an external Java app using Salesforce as the identity provider. We're using the FederationIdentifier field from the standard User object in the SAML assertion. The solution works great when a user is logged in as him/herself, but it doesn't work when a user is logged in as another user and giving Insufficient Privileges error.

Insufficient Privileges

You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary.

Internal Diagnostics:

Cannot use IdP while SU'd as another user system.security.NoAccessException: Cannot use IdP while SU'd as another user


The error message explains it nicely : We actively block SSO logins when you are logged in as a different user. 'Login as' is meant to enable Salesforce admins to support their salesforce users but it can definitely not be used as a 'backdoor' to gain access to other systems as that user. That would be a huge security hole no.

  • Daniel, will the issue occur when the user logins through his credentials ? currently this error is appearing when i do Remote lofin (grant login access)
    – Raja
    Commented Mar 13, 2014 at 9:58
  • If it is indeed a cookie issue, then no, I won't occur when the user logins directly as they won't have the Admins session cookie or be using the login-as functionality. Maybe create a new user with the same profile as the other user and login with the known username and password. Commented Mar 13, 2014 at 18:29

Double check the VF page permissions. I found that a page within a custom wizard gave that error. The second page loaded fine from the first page even when the VF access permissions were not set correctly, but when the second page needed to be refreshed, the user had insufficient privileges. When I made sure all the pages were listed for VF access, everything worked fine. And it was the second page that the user did not have the correct permissions to access. (I know this is an old question, but I wanted to note my experience in case it is helpful for anyone with the problem in the future.)

You must log in to answer this question.

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