As many of you know, SharePoint 2013 no longer has the “Sign in as a different user” option like SharePoint 2010 offered. Many of you also know that you can just add “_layouts/closeConnection.aspx?loginasanotheruser=true” to the end of your main site url to do it or log into IE as a different user. This can become a hassle though to have to do it each time.
Recently, I came across this site that had a neat trick to include the javascript in an html file and create a bookmark for it from the link in the html file. Here’s the site/steps: http://blog.credera.com/technology-insights/microsoft-solutions/how-to-sign-in-as-a-different-user-in-sharepoint-2013/
Please read the comments as well as some users modified the script to be even more helpful! I just thought I’d share because it’s saved me a lot of time.
Here is the code to add to an html file and then drag it to your toolbar for quick access!
<a href="javascript: (function(){if (typeof SP !== 'undefined') { var ctx =
new SP.ClientContext.get_current(); var site = ctx.get_site(); ctx.load(site,
'Url');ctx.executeQueryAsync(Function.createDelegate(this, function (sender, args) { var url =
site.get_url();window.location = url + '/_layouts/closeConnection.aspx?loginasanotheruser=true';
}),Function.createDelegate(this, function (sender, args) { alert('Error: ' + args.get_message());
}));} else { alert('Error: This is not a SharePoint 2010 or 2013 website'); }})();">SP
Login</a>