[jcifs] Question about NTLM authenication

Wong, Connie CY Connie.CY.Wong at pccw.com
Mon Dec 29 07:30:41 GMT 2003


Hi all,
    I've solved the problem. I've enabled the guest login in my CORP domain
controller. So it accept invalid user login.
Cheers,
Connie

-----Original Message-----
From: Wong, Connie CY 
Sent: Monday, December 29, 2003 11:49 AM
To: jcifs at lists.samba.org
Subject: [jcifs] Question about NTLM authenication


Dear all,
 
    I have problems when testing this code (copied from the FAQ about
authenication against NT domain):
    Since my PC has logined to Corp domain, when I run this program, even if
the username "abc" is an invalid user to CORP domain, it will still prompt
"Login Success". "Authenication Failure" will prompt only when I input the
valid user but invalid password. Why will this happpen?? Please Help!!!
 
    import jcifs.UniAddress;
    import jcifs.smb.SmbSession;
    import jcifs.smb.NtlmPasswordAuthentication;
    import jcifs.smb.SmbAuthException;
    import jcifs.smb.SmbException;
 
    public class ConnieLogon {
 
        public static void main( String argv[] ) throws Exception {
        
            UniAddress mydomaincontroller = UniAddress.getByName( "x.x.x.x"
);        <-- (where x.x.x.x is my corp domain controller)
            NtlmPasswordAuthentication mycreds = new
NtlmPasswordAuthentication( "corp", "abc", "abc" );
            try {
             SmbSession.logoff;
             SmbSession.logon( mydomaincontroller, mycreds );
             //Success
             System.out.println( "Login Success" );         
            }
            catch (SmbAuthException sae) {
             //AUTHENTICATION FAILURE
             System.out.println( "AUTHENTICATION FAILURE" );
            } 
            catch (SmbException se) {
             //NETWORK PROBLEMS
             se.printStackTrace();
            }   
        
        }
    }
 
 
 
Thanks & Regards,
Connie
 
 

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


More information about the jcifs mailing list