Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP against Notes names file

Status
Not open for further replies.

LTeeple

Programmer
Aug 21, 2002
362
CA
Hello,
I am looking to use LDAP to authenticate against a Lotus NAB. I have no problem doing this using the user's full first name and last name, however, I want to be able to do it using the user's ShortName, which I can't successfully do. Can someone tell me if this is even possible? I'm using PHP by the way...

Here's my code for reference:
$dn="CN=" . $username . ", OU=OrganizationalUnit, O=Organization";
$ldaphost="ldaphost.com";
$ldapport=nnn;
$ip = "ldaphost.com:nnn";
if (!($ldap = ldap_connect($ldaphost,$ldapport))) {
die ("Could not connect to LDAP server");
}
if (!($res = @ldap_bind($ldap, $dn, $password))) {
die ("<div align=\"center\"><h3>Invalid username or password: Please try again</h3><a href=\"login.php\">Go back to login page</a></div>");
}

Any advice is helpful, thank you!

[cheers]
Cheers!
Laura
 
You're code is pointing to CN (Common Name). That is the full name. I'm not sure what the notes attribute for the shortname is, but that's what you should use if you want to use the shortname. Using that, and assuming the attribute name is uid, it should look something like this...

uid=shortname,ou=orgunit,o=org

Also, make sure the shortname attribute in the NAB is searchable by everyone, or else your app probably won't be able to see it.

 
Hi, Thanks for your response.

It turns out that this is simply a limitation, which I cannot take advantage of. It's no biggie though. It's just the difference between someone typing in their full name vs first initial last name.

[cheers]
Cheers!
Laura
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top