Recently found an ad this thing old fire, especially related to the security of this aspect, so the AD domain user authentication has become the network security aspects of the product must now! Here is a simple share, Java through the JCIFS integrated AD domain users to achieve authentication to achieve network security!
We look through a demo to see JCIFS implementation Sso,sso English full name single Sign on, one sign-on. SSO is a multiple application system in which users can access all trusted applications with only one login. It includes a mechanism to map this primary login to other applications for the same user's login. It is one of the more popular solutions for enterprise business integration.
The first step: put the Jcifs-1.3.15.jar into Tomcat's WebApp directory.
Step two: Configure in Web.xml:
<filter> <filter-name>NtlmHttpFilter</filter-name> <FILTER-CLASS>JCIFS.HTTP.NTLMHTTPF Ilter</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> <!--more Highlights: http://www. bianceng.cn/programming/java/--> <!--log rank--> <param-value>6</param-value> &L
T;/init-param> <init-param> <param-name>jcifs.smb.lmCompatibility</param-name> <param-value>0</param-value> </init-param> <init-param> <param-n
Ame>jcifs.smb.client.useextendedsecurity</param-name> <param-value>false</param-value> </init-param>
<init-param> <param-name>jcifs.smb.client.username</param-name> <!--account--&
Gt <param-value>administrator</param-value> </init-param> <init-param> <para m-name>jcifs.smb.client.password</param-name> <!--password--> <PARAM-VALUE>ADMIN</PA ram-value> </init-param> </filter> <filter-mapping> <filter-name>ntlmhttpfilte R</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Step three: Deploy the restart service to see the effect
If the domain user and password are not entered here and the domain user and password are incorrect, you will not be able to access other data!