tags:

views:

55

answers:

2

If I added data on LDAP in this way:

 $ldapserver = "mail";
 $ds   = ldap_connect($ldapserver);
 $r    = ldap_bind($ds, $ldaprootun, $ldaprootpw);
 add = ldap_add($ds, "cn=$full_name,ou=$domain,o=mygroup.com", $infonew);

Then does that mean that when I log in to my account I will use:

  `cn="mynameHere",ou="domainIused",o=mygroup.com`

as my username? Or just my uid?

My account cannot login but I'm sure that it exists in LDAP.

Answers are very much appreciated. =)

A: 

Typically in LDAP applications you only ned to login with your UID, not your full X.500 name.

Try calling ldap_bind() with your creds and see what it returns?

Alan
thanks! i will.
Suezy
A: 

Usually, the user provides a simple name. Then the app searches the LDAP source for some attribute that has that value. Then you bind or password compare in your code, as that full DN.

You can use uid which is Unique ID, which is required to be unique. I.e. If you find more than one instance of it, that is an error.

You can try CN, but that can often be multi valued depending on your LDAP implementations schema.

If you know you are going against eDirectory, then uid is fine, or CN just do something if it is multi valued.

If you know you are going against Active Directory, you can assume sAMAccountName is unique since the system enforces uniqueness. userPrinicpalName ought to be unique, but nothing actually enforces it.

You can always use mail, which is the email address pretty uniformly.

geoffc