0

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.

2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by pooja.shinde
0

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

0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.