[jcifs] NT Authentication and Samba file access

Michael B Allen mba2000 at ioplex.com
Mon Oct 24 18:23:29 GMT 2005


On Mon, 24 Oct 2005 17:52:17 +0100
"Mike Streeton" <mike.streeton at ardentia.co.uk> wrote:

> I want to use a users NT Authentication credentials to access a file
> later on the same session. I am capturing the NtlmPasswordAuthentication
> object generated by NtlmHttpFilter.negotiate(). I am using this to
> create a SmbFile(URL, NtlmPasswordAuthentication), but this gives me
> "jcifs.smb.SmbAuthException: Logon failure: account currently
> disabled.". My account is not disabled and I can access the app okay
> using NT Authentication but not download a file. Sometimes I get
> "jcifs.smb.SmbAuthException: Invalid access to memory location.". We
> want to ensure that a user has privileges to download a file before
> sending it back. Any ideas?

Can't do it. The authentication challenge is specific to the target
server. In the case of the NtlmHttpFilter the target server is the domain
controller so unless you're accessing files only on the domain controller
it won't work.

However, you can do NTLM HTTP authentication with the file server
instead. That's what the NetworkExplorer servlet does. But beware that's
NOT as simple as it looks. Every once in a while someone askes about this
and I say "look at NetworkExplorer" but they always come back because
they're having problems so I say "you MUST follow NetworkExplorer". I
can't recall if anyone actually listened to that advice.

Mike

BTW "account currently disabled" means the credentials are being lost
and GUEST is being used and "Invalid access to memory location" means
the challenge is not for the target server.


More information about the jcifs mailing list