[jcifs] how to cache NtlmPasswordAuthentication

Michael B Allen ioplex at gmail.com
Tue Sep 8 14:08:31 MDT 2009

On Tue, Sep 8, 2009 at 2:00 PM, snowc<chsnow123 at gmail.com> wrote:
> I've commented out the properties (including the wins server).  I was passing
> an IP address for the domain controller and not a dns name, so I don't think
> the problem is dns.  The files are stored on a QNAP NAS server which
> authenticates with a windows 2003 active directory server.  Logging in with
> smbclient from a remote box takes milliseconds, but the first image loaded
> through jcifs is taking approx 10 seconds. My authentication code is
> effectively:
> UniAddress dc = UniAddress.getByName( "" );
> auth = new NtlmPasswordAuthentication( "dh.local", userName, password );
> SmbSession.logon( dc, auth );

I don't really understand what you're trying to do here. The
SmbSession.logon() method just validates some credentials. Also, even
though the API documentation does not indicate so, it is deprecated.

Just pass that NPA to an SmbFile constructor and get rid of the
logon() stuff. That does nothing.

Michael B Allen
Java Active Directory Integration

More information about the jCIFS mailing list