[jcifs] Domain Controllers

Jonathan D Trumbull Jonathan.Trumbull at abbott.com
Wed Feb 2 19:29:22 GMT 2005


Mark,

>>My question is, is it possible to avoid providing hard-coded domain 
controllers
(dc) to the logon method?<<

You can also use a WINS server to identify the current domain controller 
for a given domain like this:

<init-param>
        <param-name>jcifs.netbios.wins</param-name>
        <param-value>10.229.249.50,10.229.248.50</param-value>
</init-param>

On windows, you find your primary and secondary WINS servers using:

c:>ipconfig /all

Not sure what happens when the WINS server changes!  Perhaps there is a 
way to poll through ~DHCP.

--Jonathan





MSDean at beckman.com
Sent by: jcifs-bounces+jonathan.trumbull=abbott.com at lists.samba.org
02/02/2005 01:18 PM

 
        To:     jcifs at lists.samba.org
        cc: 
        Subject:        [jcifs] Domain Controllers


I am using JCIFS to perform NTLM authentication in a Weblogic environment. 
I
have created a custom authenticator, and the login method is included 
below.

My question is, is it possible to avoid providing hard-coded domain 
controllers
(dc) to the logon method?

I have to deal with many domains, each of which may have several 
associated
domain controllers. I am trying to find a way to avoid the need to 
explicitly
provide domain controllers to the login method, since the controllers may 
not
always be available or are subject to change.

Any suggestions would be appreciated.

Thanks,
Mark


      private boolean login( String userName, String domainName, String
controller, String password ) throws FailedLoginException {
            boolean succeeded = false;
            try {
                  UniAddress dc = UniAddress.getByName(controller);
                  NtlmPasswordAuthentication auth = new
NtlmPasswordAuthentication(domainName + ";" + userName + ":" + password);
                  SmbSession.logon(dc, auth);
                  succeeded = true;
            } catch (SmbException e) {
                  logger.error("Authentication failed.", e);
                  return false;
            } catch (UnknownHostException e) {
                  logger.error("Authentication failed (unknown host).", 
e);
            }
            logger.info("Authentication succeeded.");
            return succeeded;
      }





-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list