My
Java web project needs to get a user's phone# by using his/her username(intranet login name), so I think the employee's phone# is available from company's Active Directory, so I am trying to access the access Active Directory to get the phone#, but I have problem to get it, basically, I need to bind the server by using employee's user ID and password, but there is no way I can get all employee's password to get their information (phone#), I also can not use Admin's password in my java codes. something like this example:
....
Hashtable<
String, String> ldapEnv = new Hashtable<String, String>(11);
ldapEnv.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
ldapEnv.put(Context.PROVIDER_URL, "ldap://dom.fr:389");
ldapEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
ldapEnv.put(Context.SECURITY_PRINCIPAL, "cn=jean paul blanc,ou=MonOu,dc=dom,dc=fr");
ldapEnv.put(Context.SECURITY_CREDENTIALS, "pwd");
...
Is there anyway to get the employee's data (phone#) without using any authentication (userID and password)? basically, I just need to read (search) the active Directory by employee's username, not need to do any updating.
basically, I need to make anonymous queries to Active Directory. I need to make anonymous queries to return employee's phone# by using his/her username without needing to configure Active Directory to allow these queries. from this post:
http://support.microsoft.com/kb/320528 it seems that I have to configuration, but I do not want to do any configuration for my company's active directory just due to my this simple request.
I appreciate is anybody have any good example. thanks a lot,