[jcifs] SmbSession.logon and multiple domains

Colonna-Romano, John JCRomano at infoclarus.com
Fri Jul 25 02:25:18 EST 2003

I am trying to write an app that authenticates a domain and username and then uses the two fields to access some information in a database.  SmbSession.login seems to work correctly with multiple domains, and also with trust relationships.  The problem (at least for me) is that it ignores the domain name.  If I create an NtlmPasswordAuthentication object, and put any domain name in it, if the username and password are valid for some domain that the host trusts, then the authentication succeeds.  

For example, if I have two domains (A and B) and domain B trusts domain A.  I then have machine [a] in domain A and machine [b] in domain B.  If I set my host (first argument to SmbSession.logon) to [a] then I can use any domain name and a valid username and password in domain [a] and the authentication succeeds.  If I set my host to [b], I can use any domain name and any valid username and password in either A or B and the authentication succeeds.  However, I don't know in which domain the valid username and password authenticated in.  I was hoping that the returned NtlmPasswordAuthentication object might update the domain to the domain name that succeeded, but the domain name passed in isn't changed.

I may be doing something wrong, or maybe SmbSession.logon wasn't supposed to handle this the way I need.

Any suggestions are greatly appreciated.


More information about the jcifs mailing list