[jcifs] Problems accessing file using NTLM

Michael B Allen mba2000 at ioplex.com
Wed Nov 1 16:18:38 GMT 2006

On Wed, 1 Nov 2006 12:23:37 -0000
"Mike Streeton" <mike.streeton at ardentiasearch.com> wrote:

> I am trying to access a file after using NTLM challenge to authenticate
> with the browser. This works okay authentication takes place
> unfortunately it then fails when accessing the file with;
> jcifs.smb.SmbAuthException: Invalid access to memory location.
>       at
> jcifs.smb.SmbComSessionSetupAndX.<init>(SmbComSessionSetupAndX.java:44)

You cannot use an NtlmPasswordAuthentication credential acquired through
HTTP authentication to access remote resources on targets other than the
target server that issued the challenge from which the password hashes
were computed. Meaning you could access remote files on the domain
controller used to authenticate the client but anywhere else and you
get this exception.

Look at this code:

  if( auth.hashesExternal && auth.challenge != session.transport.server.encryptionKey ) {
      throw new SmbAuthException( SmbException.NT_STATUS_ACCESS_VIOLATION );

If you want to access resources on other servers you
will need to reauthenticate with each server like the
src/jcifs/http/NetworkExplorer.java servlet.


More information about the jcifs mailing list