Wednesday, December 21, 2011

IE & Sharepoint 2010 UserProfile Cache Issue

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.
And Second way:
1) Upload jquery file in one of your library and copy the path.
Edit your v4.master and add fallowing js codes. (Using JQuery)

<script type="text/javascript" src="<<Path of the jquery library >>"></script>
<script type="text/javascript" >
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()
   /* Note : this command is support with only IE  */
  catch (e) { }
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://[SharepointSiteURL:port]/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”

No comments:

Post a Comment