This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Changing LDAP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Changing LDAP "Search Attribute"" Watch "Changing LDAP "Search Attribute"" New topic

Changing LDAP "Search Attribute"

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230

I am authenticating against LDAP as such:

Hashtable authEnv = new Hashtable();
String dn =
"CN=" + userAuth.getFirstName() + " " + userAuth.getLastName() +

authEnv.put(Context.PROVIDER_URL, "ldap://");
authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
authEnv.put(Context.SECURITY_PRINCIPAL, dn);
authEnv.put(Context.SECURITY_CREDENTIALS, password);

I am using the user's first and last name to authenticate. Now, I want to use their login id to authenticate. I was told "to change the Search Attribute from 'uid' to 'sAMAccountName'". I don't know what this refers to. Does anybody have any ideas?

Consider Paul's rocket mass heater.
subject: Changing LDAP "Search Attribute"
Similar Threads
Tranasaction Rollback in JAVA LDAP API
JNDI, LDAP, & Active Directory
problem in LDAP Authentication
WLS6.1 - Configuring realm for openLdap