[jcifs] Domain Controllers
MSDean at beckman.com
MSDean at beckman.com
Thu Feb 3 22:51:09 GMT 2005
Mike,
I understand. I am not using HTTP authentication, but rather building a custom
authenticator (for BEA).
The code below (setting jcifs.smb.client.domain dynamically) seems to be working
fine.
static public boolean login (String domain, String username, String
password) {
boolean isSuccessful = false;
try {
System.setProperty( "jcifs.netbios.wins", "<IP1>,<IP2>" );
System.setProperty( "jcifs.smb.client.domain", domain );
// method 1
//UniAddress dc = new UniAddress( NbtAddress.getByName(
domain, 0x1c, null));
// method 2 (better)
NtlmChallenge chal = SmbSession.getChallengeForDomain();
UniAddress dc = chal.dc;
System.out.println("Test: found a domain controller: host
address=" + dc.getHostAddress() + ", hostname=" + dc.getHostName());
SmbSession.logon( dc, new NtlmPasswordAuthentication( domain,
username, password ));
isSuccessful = true;
} catch (SmbException e) {
System.err.println(e.getMessage());
} catch (UnknownHostException e) {
System.err.println(e.getMessage());
}
return isSuccessful;
}
Do you see a flaw in this logic?
-Mark
"Michael B Allen"
<mba2000 at ioplex.c To: MSDean at beckman.com
om> cc: jcifs at lists.samba.org
Subject: Re: [jcifs] Domain Controllers
02/03/2005 02:43
PM
MSDean at beckman.com said:
>
> Thanks.
>
> Is there a way to set the domain dynamically (since I will be
> authenticating
> against many domains).
>
> Could I do this?:
>
> System.setProperty( "jcifs.smb.client.domain", "DOMAIN" );
No. The NTLM HTTP protocol does not provide the domain so it is not
possible to authenticate users from multiple domains through the same
filter instance. But note, a user can authenticate against the DC of any
domain with which it has a trust relationship.
Mike
More information about the jcifs
mailing list