Wednesday, August 15, 2012

Unable to Sign Out of a Site that is not “Shared” to you in SharePoint 2013

by Matthew McBride
In my early testing of SharePoint 2013, I ran across an extremely annoying “bug.” If you attempt to log into a site that has not been “shared” to you by a Site Collection Administrator (SCA), you receive the following error message:
(Click on pictures for expanded view)

OK…fair enough. But the annoying part is that there is no way to log out of the current session. While testing Claims Authentication in SharePoint 2013, I would often test logging in with an FBA user and run across this issue. The headache for me was that I was unable to sign in as a Windows SCA and make the appropriate change. I tried closing down all sessions of Internet Explorer (IE), waiting for it to “timeout,” etc. The only workaround I was able to use was to open an InPrivate session in IE and log in there:
But even that is still a hassle if you are testing several different areas that involve logging in and out with different authentication methods and permission levels. Fortunately, I was able to find a somewhat easier method that will allow you to sign in as a different user. If you append the following string to the URL, you are logged out and taken back to the default sign-in page:
So, in my case, I changed it from this:

To this:

After that, I was finally able to get back here:

To make the process faster, you really only need to replace everything after “AccessDenied.aspx?” with “loginasanotheruser=true” and it will work. I’m really hoping Microsoft adds something to the UI to make this process better, but for right now the method above is your best bet.