Have you created a public facing SharePoint website, but every time you try to visit the site on a mobile phone you get a login security prompt? This issue occurs because the SharePoint Site reads your user agent on your cellphone as a mobile browser and redirects your phone to the mobile version of the website. Your site allows for anonymous users, but that access only seems to be allowed when using a web browser on a desktop computer. That’s because the SharePoint 2010 mobile site only works with authenticated users, therefore not allowing anonymous users to visit.

The Solution? Go to the following virtual directory of your SharePoint server and first make a backup copy of the compat.browser and place it in a separate location. Do not place the backup of the file in the same location because SharePoint will read the wrong file it needs and your site will stop working. Next, open up the compat.browser file in the App_Browsers folder of your site directory using a text editor.

File Location:

C:inetpubwwwrootwssVirtualDirectoriesyoursiteApp_Browsers

 


Once you open up the compat.browser file is open you will notice a bunch of entries for all the defined “UserAgent match=” device types that SharePoint 2010 supports is also a good place to add future devices. In the example below you will see that I have selected the User Agent for “Office Mobile Web Access” which is the User Agent for Windows Phone 7 Devices.


In the code above you will find the line of code that tells these devices to get redirected to the mobile site of the Web Application your SharePoint site is housed on. Within the “capability” tag we see

<capability name=”isMobileDevice” value=”true” />.

To allow Widows Phone 7 devices to view the SharePoint site as intended by the author we need to set the isMobileDevice value to false. <capability name=”isMobileDevice” value=”false” />. Rinse and Repeat for all of the other devices that you choose to support for your website.

Another workaround, which will disable the redirect for all mobile browsers, is to disable the capability of isMobileDevice entirely. This can be done by adding the following snippet in the system.web section of the web.config of your Web Application:

<browserCaps> <result type=”System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” /> <filter>isMobileDevice=false</filter></browserCaps>

The above code makes SharePoint think that all browsers are using a desktop browser and therefore no mobile redirect should be done. If you apply this workaround and navigate to your SharePoint site, you will be able to open it without the login prompt and SharePoint will think you are a Desktop Anonymous User.