How-to: Setup Firefox for use with Sharepoint NTLM Authentication

Preferred Editor: Notepad++
Microsoft VBScript: Language Reference
FFDeploy: Automated deployment of Firefox with extensions, themes, and pre-configuration

We don’t have many strict policies regarding installed applications at work; employees have their choice of web browser, for example. When it comes to using our Sharepoint intranet site, this poses a problem. By default Firefox will prompt the user for a username and password when attempting to login to the site, whereas Internet Explorer will automatically use built-in NTLM authentication to authenticate with the site using Active Directory.

Fortunately, Firefox can be setup to do this, however it does require some tweaking of sorts. In the about:config page, you’ll find an option called network.automatic-ntlm-auth.trusted-uris which will enable Firefox to use Windows’ built-in NTLM authentication; allowing users to simply open the Sharepoint site without hassle. Unfortunately, having to set this manually on all the computers on the network that were already using Firefox, plus the additional worry of setting this manually on any new systems or users who decide to use Firefox seemed like an annoying task.

I Googled for a solution, but unfortunately there weren’t any that immediately performed the actions I required. Fortunately though, there does exist a nice utility by the name of FFDeploy which I was able to take parts of — specifically, the VBScript — in order to make possible what I had envisaged.

Essentially, all my script does is check for the existence of a Firefox directory buried within Application Data of the user logging on; if this exists, we copy over a special user preferences file, user.js which overrides or appends to same-values set in the global prefs.js (reference).

The bulk of the script I will keep seperate, as it can be had by downloading FFDeploy. My simple use is as follows:

  1.  
  2. ‘script to setup FireFox on users pc’s with SharePoint NTLM auth
  3. ‘code borrowed from "FFDeploy"
  4. ‘licenced under Mozilla http://www.mozilla.org/MPL/
  5.  
  6. ‘first create a FileSystemObject to manipulate files
  7. Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
  8. ‘create a shell scripting object
  9. Set SHO = WScript.CreateObject("WScript.Shell")
  10. ‘some helper variables
  11. AppData = SHO.ExpandEnvironmentStrings("%APPDATA%")
  12. ‘check to see if the user actually has Firefox installed & find the users local directory
  13. If FSO.FileExists(AppData + "\Mozilla\Firefox\profiles.ini") Then
  14.     FFProfName = GetINIString("Profile0", "Path",,AppData + "\Mozilla\Firefox\profiles.ini")
  15.     FFProfName = Right(FFProfName, Len(FFProfName)-InStr(FFProfName,"/"))
  16.     FFProfPath = AppData + "\Mozilla\Firefox\Profiles\" + FFProfName
  17.         ‘now copy our user.js preferences
  18.         FSO.CopyFile "G:\IT\clients\user.js", FFProfPath + "\", true
  19. End If
  20. ‘user doesn’t have Firefox installed, do nothing
  21.  

GetINIString is a function provided by the VBScript in the FFDeploy utility; though it would be relatively straightforward to reconstruct, or write a sub to perform the same action for this specific usage. The line FSO.CopyFile() near the bottom is where we actually copy the user.js file from the server. When the condition isn’t met, we simply exit the if block and do nothing.

Simple, huh?


About this entry