sharepoint 2013 sign out problem

open iis manager,right click your sharepoint site,click 'Authentication',disable 'windows authentication'

 

Sharepoint 2010 complete sign out

When you using Windows Authentication  (NTLM + AD) with your sharepoint site you may want to enter credential after  you sign out from your site.But it is not easy and somehow imposible when using authentication NTLM and IE .Beacuse after you sign out and try to login again ,automatic login proccess logs you in immediately.

I can explain you two alternative way two prevent automatic log on.

First solution which is my suggested way. Dont use windows authentication . Use Claim Based Authentication (CBA)+ (Forms Based Authentication) FBA  with Active Directory (AD) membership.

http://blogs.msdn.com/b/sridhara/archive/2010/01/07/setting-up-fba-claims-in-sharepoint-2010-with-active-directory-membership-provider.aspx

And Second way:

1) Edit your v4.master and add fallowing js codes. (Using JQuery)

<script type="text/javascript" src="/_catalogs/Scripts/jquery.js"></script>
<script type="text/javascript" >
$(document).ready(function(){$("#zz15_ID_Logout").attr("onMenuClick","STSNavigate2(event,'/SitePages/logout.aspx');");});
</script>

//This code added for testing jquery working correctly.

<script type="text/javascript" >
$(document).ready(function(){alert("Jquery is working");});
</script>

2) create a new “logout.aspx” page which masterpage is v4.master using Sharepoint Designer

3) add the fallowing code to your new sign out page

<script type="text/javascript">
function _spBodyOnLoad()
{
try
{
   /* Note : this command is support with only IE  */
  document.execCommand("ClearAuthenticationCache",false);
}
  catch (e) { }
  window.location='/_layouts/signout.aspx'; 
}
</script>

4) For testing choose a different machine than sharepoint server and configure your browser Tools->Internet Options->Security->Local Intranet
Click Custom Level and find Logon and change it to “Prompt for user name and password”
And be sure your site not added to trusted zone sites.

Login your site and type your browser’s addres bar
http://%5BSharepointSiteURL:port%5D/SitePages/logout.aspx and press enter
Try again to login and see asking your credentials.

when your sharepoint site url does not contain dot “.” that IE suppose that its a Local Intranet site. Thats why we changes the Local Intranet Zone settings to “Prompt for user name and password”

If you want to be behave your site an Internet Site by IE

1) First complete solution above and test its working.
2) Set your sites host header url like “www.testsignout.com” in your IIS

  1. Open IIS mmc
  2. Select your Sharepoint Web Application
  3. Click bindings
  4. add your host header

3) Add an alternet access mapping as “www.testsignout.com” from Central Administration site.
4) If you dont want to add a dns record like me append this url to your client machine host file where you want to test your sign out process.

example:
192.168.10.55 http://www.testsingout.com

See default action for IE as Internet zone asking to you your credentials.
Warning : this solution is not compatible for browser except IE.and possible clear your auth cookies with other sites in IE tabs when you surfing in internet. (dame i need to remember my face pass again.)

Resources:

http://social.msdn.microsoft.com/Forums/en/sharepointcustomization/thread/f9021dbf-59e2-4aca-b4fc-3f464b802df9

 

posted @ 2013-05-13 09:37  zyip  阅读(835)  评论(0编辑  收藏  举报