Implementing JCIFS filters for NTLM support in ColdFusion MX
The Common Internet File System is a platform independent file sharing protocol based on Microsoft's Server Message Block protocol. CIFS runs atop TCP/IP and provides stateful file access. Java CIFS (jCIFS) is an open source client library from Samba that provides a 100% Java implementation of CIFS/SMB networking protocols.
Microsoft's NTLM (Windows NT Lan Manager) is a common authentication protocol used with Internet Information Services (IIS). It provides challenge and response authentication against Windows domain controllers for access to web resources. Now known as Integrated Windows Authentication, it provides transparent logon for the logged in user. Customers can use JCIFS to provide NTLM HTTP authentication against Windows domains from within ColdFusion.
Perform the following steps to implement NTLM HTTP Authentication using JCIFS:
- Download the latest JCIFS JAR from http://jcifs.samba.org/src/ (1.2.7 as of 12/5/05).
- Extract the jcifs-1.2.7.jar to the WEB-INF\lib folder:
- Server Configuration: extract tocf_root\wwwroot\WEB-INF\lib
- J2EE Configurations (including JRun 4): extract to cf_web_root\WEB-INF\lib
- Edit ColdFusion's web.xml:
- Server Configuration: editcf_root\wwwroot\WEB-INF\web.xml
- J2EE Configurations (including JRun 4): editcf_web_root\WEB-INF\web.xml
Note: For ColdFusion MX 6.1 change the DOCTYPE directive at the top of the web.xml to<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">. - Add the relative <filter> and <filter-mapping> directives to the <web-app> definition.The following sample directives provide NTLM authentication for the CFIDE directory against the MACROMEDIA domain:
<filter><filter-name>NtlmHttpFilter</filter-name><display-name>NtlmHttpFilter</display-name><filter-class>jcifs.http.NtlmHttpFilter</filter-class><init-param><param-name>jcifs.smb.client.domain</param-name><param-value>MACROMEDIA</param-value></init-param><init-param><param-name>jcifs.netbios.wins</param-name><param-value>10.176.24.170</param-value></init-param></filter><filter-mapping><filter-name>NtlmHttpFilter</filter-name><url-pattern>/CFIDE/*</url-pattern></filter-mapping>
- Save the web.xml file.
- Restart ColdFusion.
Additional Information
- Implementing NT authentication for ColdFusion templates with IIS Web Server
- JCIFS Client Library home page
- CIFS: A Common Internet File System
This content requires Flash
To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.
Download the free Flash Player now!
