- Download jCIFS from the site.
- The following three lines of code are enough to check authentication
UniAddress uniaddress = UniAddress.getByName(LDAP_Host_Name);
NtlmPasswordAuthentication ntlmpasswordauthentication = new NtlmPasswordAuthentication(domain, username, password);
SmbSession.logon(uniaddress, ntlmpasswordauthentication); If the authentication fails, then the logon method throws an exception.
Thursday, August 03, 2006
Using jCIFS for Authentication
JCIFS is an Open Source client library that implements the CIFS/SMB networking protocol in 100% Java. CIFS is the standard file sharing protocol on the Microsoft Windows platform (e.g. Map Network Drive ...). This client is used extensively in production on large Intranets. The JCIFS SMB client library enables Java applications to remotely access shared files and directories on SMB file servers(i.e. a Microsoft Windows "share") in addition to domain, workgroup, and server enumeration of NetBIOS over TCP/IP networks. It is an advanced implementation of the CIFS protocol supporting Unicode, batching, multiplexing of threaded callers, encrypted authentication, transactions, the Remote Access Protocol (RAP), and much more. It is licensed under LGPL which means commercial organizations can legitimately use it with their proprietary code(you just can't sell or give away a modified binary only version of the library itself without reciprocation). While the core library is for implementing File Sharing, we can also use it for authentication using LDAP. The following are a sequence of steps to setup jCIFS for authentication:
Labels:
authentication,
security
Subscribe to:
Post Comments (Atom)
Popular Posts
-
In a previous post, I described how to use Quartz scheduler for scheduling . In this post, I describe the configuration changes required for...
-
The previous post described how to implement a JMS messaging client using Spring JMS . This post will describe how to implement the Message ...
-
This post will describe how to create and deploy a Java Web Application war to Heroku using Heroku CLI. You will need a basic understanding ...
-
JUnit 4 introduces a completely different API to the older versions. JUnit 4 uses Java 5 annotations to describe tests instead of using in...
-
Roller is a Java based blog server. It is in Apache incubator as of now. Roller drives Sun Microsystem's blogs.sun.com employee bloggi...
-
New posts with iText 5.5.12 Following are two new posts for PDF Merge with iText 5.5.12 Merge PDF files using iText 5 Merge and Paginate PDF...
-
In the previous post, I described the use of Displaytag to implement paging in a simple JSP. In this example, I describe the use of Displayt...
-
In the past, I wrote a post on how to implement Web Services using JAX-WS on Glassfish, and Apache Axis. In this post I will describe how to...
-
Update: A new post for validation in struts with annotation is available at: Struts 2 Validation: Annotations . Struts 2.0 relies on a val...
-
Redhat Enterprise Linux provides Redhat Developer Toolset , which allows you to install Git. However, it is usually an older version. If you...
Thanks Abhi..This is really a nice and helpful blog on desktop sso...I have gone through the docs provided on jcifs and implemented the desktop sso..But I am failing to find the right steps to implements jcifs on HTTPS..Its working fine on HTTP..Any thouhgts on this..?
ReplyDeleteo you get the variable password? can you mail this answer? pakizito[AT]gmail[dot]com
ReplyDeleteThanks so much! Works like a charm.
ReplyDeleteOn our company's local network, using the AD's ip address instead of hostname (ad.local) made a 4,000 msecs difference, which is probably the lookup timeout...?