Nick Grattan’s SharePoint Blog

About Microsoft SharePoint and some .NET

Logging in as a different user

with one comment

When using default.master in SharePoint users have the “Sign in as Different User” menu option on the “Welcome” menu to login as a different user. This is useful when testing security etc.

This menu is often removed when customizing sites – clients we find often do not want these options displayed. So how can you add a link to allow this facility for testing?

The “Sign in as Different User” navigates to the /_layouts/AccessDenied.aspx page, which displays thus:

Accessdenied

You’ll notice the link “Sign in as a different user”. From the browser status bar you can find the target of this link:

Accessdenied2

So, it turns out to login as another user you simply need to navigate to:

/_layouts/AccessDenied.aspx?loginasanotheruser=true

The standard browser username/password dialog box will be displayed without the “Access Denied” page being displayed to the user.

 

 

 

Written by Nick Grattan

December 3, 2008 at 1:11 pm

One Response

Subscribe to comments with RSS.

  1. Excellent! Very helpful tip.

    Robin

    March 5, 2009 at 9:45 pm


Leave a Reply