Recently found ad this thing old fire, especially related to security this aspect, so the ad domain user authentication becomes now the network security aspect product essential! Here is a simple sharing, Java through the JCIFS integration of AD Domain users to achieve authentication, to achieve network security!
We use a demo to see JCIFS implementation Sso,sso English full name Single sign on, one-point login. SSO is a multi-application system in which users can access all trusted applications with only one login. It includes a mechanism that can map this major login to other apps for the same user's login. It is currently one of the most popular solutions for enterprise business integration.
The first step: put the Jcifs-1.3.15.jar into the Tomcat WebApp directory.
Step Two: Configure in Web. xml:
[HTML]View Plaincopy
- <filter>
- <filter-name>ntlmhttpfilter</filter-name>
- <filter-class>jcifs.http.ntlmhttpfilter</filter-class>
- <init-param>
- <param-name>jcifs.http.domaincontroller</param-name>
- <!--domain server IP --
- <param-value>10.10.2.153</param-value>
- </init-param>
- <init-param>
- <param-name>jcifs.util.loglevel</param-name>
- <!--log levels --
- <param-value>6</param-value>
- </init-param>
- <init-param>
- <param-name>jcifs.smb.lmcompatibility</param-name>
- <param-value>0</param-value>
- </init-param>
- <init-param>
- <param-name>jcifs.smb.client.useextendedsecurity</param-name>
- <param-value>false</param-value>
- </init-param>
- <init-param>
- <param-name>jcifs.smb.client.username</param-name>
- <!--account --
- <param-value>administrator</param-value>
- </init-param>
- <init-param>
- <param-name>jcifs.smb.client.password</param-name>
- <!--password --
- <param-value>admin</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ntlmhttpfilter</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
If you do not enter a domain user and password here and the domain user and password is incorrect, you will not be able to access other data!