Pages Side

Wednesday, August 27, 2014

SharePoint : How to Sign in as a Different User in SharePoint

SharePoint used to have a menu option called β€œSign in as Different User” in the top-right corner of every page. It was a handy tool for developers and IT professionals in SharePoint  2010, which allowed them to login with another account to test their solutions or customizations. Microsoft removed the option in SharePoint 2013, but you can still do it with workarounds 

Why Was This Feature Removed

I don’t know exactly why Microsoft removed this feature. What I do know is it was never perfect and has a number of issues in SharePoint 2010. Some of the most common issues like the below :

β€’ Caching problems
β€’ Documents opened in external applications are saved with an unexpected user account (previous account).
β€’ Right after user logs in with a different account, the page content shows information from the previous account and the cookies are not properly cleared
In other words, this feature was never meant as a security mechanism. Therefore, even though it’s possible to bring the menu option back, you should carefully consider whether doing so is really necessary. After all, it was removed for a reason.
If you want to bring the menu option back for all users, you can modify the Welcome.ascx file  in SharePoint Farm
  • Locate the file \15\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx and open in a text editor.
  • Add the following element before the existing element with the id of β€œID_RequestAccess”:
1
2
3
4
5
6
7
<SharePoint:MenuItemTemplate runat="server" ID="ID_LoginAsDifferentUser"
 Text="<%$Resources:wss,personalactions_loginasdifferentuser%>"
 Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
 MenuGroupId="100"
 Sequence="100"
 UseShortId="true"
 />
  • Save the file.
Now, the menu item shall be displayed:

  • A slightly faster way to accomplish this is to navigate to the Close Connection page. Just visit the following URL in your browser:

http://<site URL>/_layouts/closeConnection.aspx?loginasanotheruser=true
As soon as you hit this page, the familiar pop-up will prompt you for the username to log in with. Once you log in, you will be redirected to the home page.

No comments:

Post a Comment