Integrated AD domain user authentication using jcifs in Java

Source: Internet
Author: User
Tags filter client domain server

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> &LT;FILTER-CLASS&GT;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--> &LT;PARAM-VALUE&GT;ADMIN&LT;/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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.