Hello all,

I am using Windows server 2008 OS as domain controller. When user's request comes, his id & password are verified across Active directory. If his id & password are already present in active directory then java program returns as valid user or otherwise returns as invalid user. Now, password policy is set to default.
I want minimun password length to be 4 chars. & password must be numeric. When i did these settings, java program gives authentication exception.
I have little knoweldge about Active directory integration.

Can anyone help me with active directory settings.
Plz plz help, its urgent.

Can you explain how the question is related to java programming. Post the code and the full text of the error messages.

I am using java program to connect to active directory.
code i am using is as follows:

try{    
    Hashtable env = new Hashtable();
        env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, "ldap://10.1.5.124:389");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, id);
        env.put(Context.SECURITY_CREDENTIALS, pswd);

        DirContext ctx = new InitialDirContext(env);
        Attributes attrs = ctx.getAttributes("cn="+id+",dc=rsa,dc=com");
        System.out.println("success" + ctx);
        System.out.println(attrs.get("cn"));
        System.out.println(attrs.get("Password"));
        System.out.println(attrs.getAll());
}
catch (NamingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }                

It works fine with default settings. When i make some changes, it gives authentication excpetion or naming exception. What could be the reason?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.