Bugra Postaci's Blog

All my posts are provided "AS IS" with no warranties, and confer no rights.

  • Home
  • About
  • Docs
  • Privacy
Posts Comments
  • Sharepoint
    • Sharepoint 2010
    • SharePoint 2013
    • Sharepoint Tips & Tricks
    • SharePoint 2016
    • Sharepoint Tools
  • ASP.NET
  • C#
    • Tips & Tricks
  • Uncategorized

Sharepoint 2010 complete sign out

27/04/2011 Leave a comment

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

Advertisement

Filed under Sharepoint 2010 Tagged with automatic login, ClearAuthenticationCache, IE, Jquery, Logoff, NTLM, Sharepoint 2010, Signout, Windows Authentication

RSS Register

  • RSS - Posts
  • RSS - Comments

Search

Inside my brain

2010 2013 AAM Access Denied AD ASP.NET Authentication Backup C# configuration Content Content-type CU Cumulative Database Delete deployment enum Error Excel Feature GAC GC Http HttpHandler IE8 IIS LDAP list Lock() Log meeting Moss 2007 Moss2007 mysite Ninject NTLM Performance PowerShell problem Profile RBS Redirection request Search security server Service Service Pack session Sharepoint Sharepoint 2007 Sharepoint 2010 Sharepoint2010 SharePoint 2013 Site SP1 SP2 SPS2010 SPS2013 SQL stsadm Support Supportability Sync Syncronization TimerJob tools ULS UPA Update user Web Webpart Workflow

Categories

  • .Net Tools (6)
  • ASP.NET (34)
  • C# (32)
  • Coolite (1)
  • Debugging (1)
  • Design Patterns (1)
  • IIS (4)
  • Microsoft Support (1)
  • Powershell (2)
  • Sharepoint (105)
  • Sharepoint 2010 (89)
  • SharePoint 2013 (54)
  • SharePoint 2016 (9)
  • SharePoint 2019 (3)
  • SharePoint Online (5)
  • Sharepoint Tips & Tricks (20)
  • Sharepoint Tools (7)
  • System (2)
  • T-SQL (5)
  • Tips & Tricks (10)
  • Uncategorized (30)
  • Visual Studio IDE (4)
  • Windows 10 (3)

Top Posts

  • How to collect IIS Logs for a SharePoint Web Application
  • The SPListItem being updated was not retrieved with all taxonomy fields
  • c# LDAP create new active directory user
  • SharePoint User A authenticated as User B
  • Using Distribution Groups in SharePoint for securing SharePoint securables is not possible.
  • SharePoint 2013 Workflows are not working issue
  • Stop SharePoint Completely or stopping the farm
  • IE11 "edge" mode is not supported for SharePoint 2013 and 2010
  • About future of the Content Deployment feature for SharePoint 2019
  • HTTP 500 - Internal server error page Sharepoint 2007

My Recents

  • The code execution cannot proceed because edgegdi.dll was not found
  • Who is listening on port 80 (http.sys ?)
  • Win10 Search from Start shows a black box
  • Anjular.js fragment identifier “#” hash issue with SharePoint 2019 Modern UI
  • About future of the Content Deployment feature for SharePoint 2019

Archives

  • August 2021 (1)
  • February 2020 (2)
  • November 2019 (2)
  • August 2019 (2)
  • July 2019 (2)
  • June 2019 (1)
  • May 2019 (1)
  • April 2019 (2)
  • March 2019 (2)
  • January 2019 (1)
  • July 2018 (1)
  • June 2018 (1)
  • May 2018 (1)
  • January 2018 (1)
  • December 2017 (1)
  • November 2017 (1)
  • July 2017 (1)
  • June 2017 (3)
  • May 2017 (1)
  • February 2017 (2)
  • May 2016 (1)
  • March 2016 (1)
  • February 2016 (1)
  • December 2015 (1)
  • November 2015 (1)
  • October 2015 (2)
  • August 2015 (3)
  • July 2015 (1)
  • June 2015 (4)
  • May 2015 (2)
  • April 2015 (1)
  • March 2015 (1)
  • February 2015 (3)
  • January 2015 (1)
  • December 2014 (3)
  • October 2014 (3)
  • August 2014 (6)
  • July 2014 (2)
  • May 2014 (5)
  • April 2014 (5)
  • March 2014 (2)
  • February 2014 (17)
  • December 2013 (2)
  • November 2013 (3)
  • October 2013 (5)
  • August 2013 (1)
  • July 2013 (3)
  • June 2013 (4)
  • May 2013 (2)
  • April 2013 (1)
  • March 2013 (3)
  • February 2013 (3)
  • January 2013 (4)
  • December 2012 (1)
  • November 2012 (4)
  • October 2012 (3)
  • September 2012 (2)
  • August 2012 (3)
  • July 2012 (5)
  • June 2012 (2)
  • May 2012 (3)
  • April 2012 (9)
  • March 2012 (7)
  • February 2012 (10)
  • January 2012 (8)
  • December 2011 (8)
  • November 2011 (2)
  • October 2011 (11)
  • September 2011 (10)
  • August 2011 (5)
  • July 2011 (7)
  • June 2011 (13)
  • May 2011 (2)
  • April 2011 (11)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (6)
  • December 2010 (4)
  • November 2010 (4)
  • October 2010 (14)
  • September 2010 (5)
  • August 2010 (3)
  • April 2010 (9)
  • March 2010 (7)
  • February 2010 (10)
  • January 2010 (42)
  • December 2009 (3)
  • November 2009 (9)

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Follow Following
    • Bugra Postaci's Blog
    • Join 60 other followers
    • Already have a WordPress.com account? Log in now.
    • Bugra Postaci's Blog
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar
 

Loading Comments...