Monday, June 17, 2013

iPad Safari issue with SharePoint 2010 Web Applicaton using NTLM Authentication

Problem: A SharePoint 2010 Web Application viewed on Safari on an iPad randomly prompts for  login credentials in the same browser session even though the user has already been authentication once.

This issue has ONLY been found on a Web Application with the following characteristics:

- It uses NTLM (Active Directory) Authentication

Solution: It turns out there is no OOTB solution to this issue. There are only workarounds. 

Any one of the workarounds described below should resolve this issue:

Workaround #1) The same site that does not work well with Safari on an iPad has been found to work seamlessly in the Chrome Browser on the iPad. You can either ask users to always use that site on Chrome by typing the Url or deploy a native iPad app that launches the Url of the SharePoint 2010 Web App in Chrome automatically, giving the users a more seamless experience. In the desktop world we call these shortcuts. 

Believe it or not, creating the shortcut for Chrome is not as easy on an iPad as it is on a Desktop. Apple forbids iPad users from making Chrome as the default browser, preventing any shortcut from opening Chrome. There are other solutions that have been suggested, such as the one in this link, but it still requires a user to manually set up the link. For Enterprise users, many of whom might not be very tech savvy, it might be a hard solution.

Both the Chrome app and the native iPad app suggested in this workaround could be deployed remotely to Enterprise iPads if you have an MDM solution in place, making the experience seamless for Enterprise Users. The code for the Xcode project can be downloaded here.

Once you download the project, you will need to modify the bundle identifier, upload the App Icon for your App, modify the Url to open in Chrome in the AppDelegate.m file, Build the Xcode Project, test and distribute based on your preference (Ad Hoc distribution, MDM, App Store etc.).

I got the code for the project from the following link provided by Google on how to open Urls in the Google Chrome App automatically.

https://developers.google.com/chrome/mobile/docs/ios-links

Workaround #2) Extend the Web Application to use FBA (whether you use it or not), create a different URl and have users navigate to the different Url from iPads.

You can do so using the steps outlined below:

· Zone-1: A URL that uses NTLM, good for use on internal users/desktops machines within the office.  So you can utilize the pass-through authentication of NTLM (no prompts for any password or authentication method).

· Zone-2: A secondary zone/URL for use specifically for the iPad (so the user is prompted for an authentication method and their username/password).

· It will not be possible to simply have one URL that will work seamlessly between internal users/desktop computers and iPad users, unless the internal users do not mind the hassle of selecting an authentication method and then typing in their password every time they want to access the portal.

· However, you can devise a redirect page on the main URL that will detect the user’s device (desktop, tablet, smartphone) and redirect the user to the appropriate URL (you will however still need to setup two webzones/two URLs to see this solution through). OR, you could have some sort of automatic redirect at the Firewall that determines from the device accessing the portal and then redirects the user to that url. But SharePoint will need to have 2 Urls and 2 Zones for this to work.


Workaround #1) seemed to be a better solution that Woraround #2) because of the following reasons:

a) Requires less communication to users about 2 different Urls for the same Web Application.
b) Does not require making architecture changes to the SharePoint Web Application by creating two zones, one with FBA authentication and the other one with NTLM Authentication,
c) Since the problem is specific to iPad safari, the solution should be specific to the iPad and not force us to modify the Architecture of the Web Application we set up originally.
d) If an Enterprise has a strong MDM platform, which many organizations do these days, the App developed in Workaround #1) can be deployed remotely along with the Google Chrome App and make the experience seamless for users.

Workaround #3) If there is an option to use claims based authentication, you could use  that and use Integrated Windows Authentication along with it. That has seemed to work the best on Safari, although not without issues. It often randomly prompts for login twice and works on Chrome better than Safari. However, it works much better than a web application with NTLM Authentication.


Tuesday, April 30, 2013

SharePoint 2010 List: Customize Form with Infopath Bug with Calculated Columns

I recently stumbled upon a bug with the 'Customize Form' feature on a SharePoint List. If you have a calculated column in your SharePoint List and are trying to represent it with reduced number of decimal places, either directly through the cloumn definition or through a calculated formula (such as ROUND() etc.), the value is calculated and displayed correctly in the List Views, but when you open the individual list item in an infopath form, Infopath represents the entire number, including all the decimal places, and does not respect the original column definition or any calculated formula.

The bug can be rec-created by following the steps below:

1) Create a simple Custom List  and add two columns, one called Numerator (a 'Number' type of Column) and the other one called a Denominator(a 'Number' type of Column), as shown in the screenshots below:
Numerator Column


Denominator Column

2) Add a third column, a 'Calculated' type of Column, called Num/Denom that simply divides the Numberator by the Denominator. Make sure you set the number of decimal places on this column as zero, as shown in the screenshot below:

Num/Denom Cloumn
3) Now, try to Click on 'Customize Form' in Infopath and add the Calculated Column created in Step 2) to the Infopath form, as shown in the screenshot below:


'Customize Form' View

4) Now try to add a new list item, you will notice that even though the Num/Denom is calculated and displayed correctly in the All Items view (see screenshot below), it is not displayed correctly when you open the list item (see screenshot below).



List View


The Individual List Item View
At the time of writing this blog post, I have not reported the bug to Microsoft but will be doing so soon.

Wednesday, January 16, 2013

SharePoint Farm Secure token Service Issue due to a WCF Update

I was woken up early morning yesterday and informed about an issue on our SharePoint Farm. All the web applications in the farm were down, and showing errors (as shown in the screenshot below) to any user trying to login.




My first guess was that it was a custom solution (such as a web part, event receiver, timer job) that we deployed that might have caused the issue. Upon investigation, it turned out that was not the case. I then looked at the ULS Logs. The following error was found:

"An exception occurred when trying to issue security token: The requested service, 'http://localhost:32843/SecurityTokenServiceApplication/securitytoken.svc/actas' could not be activated. See the server's diagnostic trace logs for more information.. "

We also saw the error shown in the screenshot below with the User Profile Service Application:

User Profile Application’s connection is currently not available. The Application Pool or User Profile Service may not have been started. Please contact your administrator”.

Upon checking the User Profile Service Application Pool, it was found to be running and the Services were running on the server.

This error told us that something was wrong with Authentication within SharePoint, which is probably why no user was able to log on SharePoint. This also told me that there was probably something deployed lower down the stack, probably either a SharePoint update or a Windows update that broke the STS. We started checking Windows Update and found that one of the updates applied to the server was: kb2756920

On further checking we figured that one of the update kb2756920 for Windows Server 2008 r2 looks to resolve WCF Security issues with the STS. As explained in the blog at:


However, since this is a production box, installing SP1 would have been a rigorous process and we needed to bring up our farm asap. Uninstalling the update, would have left our STS with the very vulnerabilities that the update was designed to fix. Upon calling Microsoft, we were told we could apply a SharePoint hot fix described in the link below: The hotfix is something the blog post does not mention and we learnt about it from Microsoft. It can be accessed here:






Just applying this hotfix on both the WFE and APP server and rebooting the servers brought the SharePoint Farm back up. Users were able to login successfully.

However, we still had issues with the User Profile Synchronization service. The User Profile Service Application we showing 0 profiles so we had to do a synchronization back to AD. 
Several attempts to the the AD synch failed and we got errors each time. Upon analyzing the ULS logs once again, we got the following error message: 

01/14/2013 11:47:13.52              w3wp.exe (0x0200) 0x1014    SharePoint Foundation          Runtime  tkau         Unexpected                System.IO.FileLoadException: The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)    at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager.InitializeIlmClient(String ILMMachineName, Int32 FIMWebClientTimeOut)     at Microsoft.Office.Server.UserProfiles.UserProfileConfigManager..ctor(UserProfileApplicationProxy userProfileApplicationProxy, Guid partitionID)     at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.IsProfileSynchronizationRunning()     at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage._CheckProfileSynchronizationStateAndNavigateJS()     at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.ProfileAdminPage.OnPreRender(EventArgs e)     at Microsoft.SharePoint.Portal.UserProfiles.AdminUI.SyncNow.OnPreRender(EventArgs e)     at System.Web.UI.Control.PreRenderRecursiveInternal()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     6e86cdbe-18a1-4a14-b83c-7134295e8a60


Upon searching the internet, we found the following blog post:


This blog gave us an idea to do an IISRESET on both the WFE and App Servers. AS soon as we did that, the User Profile Synchronization Service started and we were back up completely.