[jcifs] NtlmPasswordAuthentication & domain

aspa at kronodoc.fi aspa at kronodoc.fi
Wed Oct 29 01:59:54 EST 2003

On Fri, 2003-10-24 at 12:57, eglass1 at comcast.net wrote:
> ...
> If you specify a bogus domain, it will attempt to use a local account
> (succeeding if a user exists with those credentials) but won't check against
> the machine's primary domain.  If, however, you specify a *valid* domain, but
> provide credentials for an existing *local* user, it won't try the local
> account at all (it will just fail).

being a bit Windows illiterate, i'm not really sure if the account i'm
testing the authentication with is a local account or not. i was
assuming the account is not local because it can be found in the 'test
users' container in the directory tree.

testing with a valid domain name + user information the authentication
succeeds. with a bogus domain name the authentication still goes fine as
long as user name + password are correct.

here's the piece of test code i'm using:
        try {
            UniAddress mydomaincontroller =
            NtlmPasswordAuthentication mycreds =
                new NtlmPasswordAuthentication(domain, user, pass);
            SmbSession.logon(mydomaincontroller, mycreds);
            return true;
        } catch (UnknownHostException uhe) {
        } catch (SmbAuthException sae) {
        } catch (SmbException se) {
	return false;

best regards,

More information about the jcifs mailing list