What is ClearQuest’s LDAP setup trying to do? It’s a question I’ve asked myself a million times. This blog entry is an attempt to sketch out my assumptions. Follow along and see whether I’m whacked out or what.
LDAP Lookup, Not Management
The first thing that threw me was that ClearQuest uses LDAP only to do a password lookup. It doesn’t use any of the rest of the information for anything at all. Further, being in LDAP alone isn’t enough to get you into ClearQuest or to update your email address. Why is this? Probably because that lets us do two things: 1) mix LDAP and non-LDAP users and 2) continue to manage groups inside of ClearQuest.
What’s In a Name?
The second hurdle to get over was that we can set up this validation so that the thing the user types in to gain access to the system does not have to match what is in the “Login” field of the ClearQuest user management tool. That’s really hard to get the noggin around, but it’s kind of neat when you do, because ClearQuest uses that “Login” field to indicate the user’s primary key. Whatever you use as your naming structure there is what shows up in the drop-down box for user reference fields.
This is exciting, because it means that we can start putting human-readable information in the “Login” field but allow the users to use their network logins. So, for example, I can log in with jmxm253, but others can pick john_martin from the drop-down.
More Indirection
The third hurdle was tougher, probably because I don’t see a great use for it. It seems that ClearQuest will let you do two validation checks.
When you configure ClearQuest to use LDAP, you take three important steps:
- Create a connection method/password/etc for getting into the LDAP provider (e.g., a username to log into Active Directory and browse around)
- (installutil setldapinit)
- Create a search string for finding the user who’s trying to log in
- (installutil setldapsearch)
- Create a mapping to connect a ClearQuest user field (like login_name or email) to an LDAP field (like sAMAccountName or mail).
- (installutil setcqldapmap)
The really weird part that throws you for a loop, IMHO, is that #2 and #3 don’t have to be related! The example provided with the instructions seems to imply that if you set your search criteria in #2 to be sAMAccount=%login%, then you also must set the mapping up so that CQ_LOGIN_NAME maps to sAMAccountName. And I wracked my brain to figure out why you’d have to do #3 if you’re doing #2.
This is the important bit: %login% is what the user types into the login box when he/she launches ClearQuest. %login% doesn’t have to be the thing the administrator puts into login_name in the CQ user tool or in any other field.
Here’s the flow of events when an LDAP-enabled user logs in:
- User launches ClearQuest for Windows.
- User types in a User Name. The User Name will match whatever you set equal to %login% in STEP 2 above. If you said something like (sAMAccountName=%login%), then the user types in his/her network login ID. If you said something like (mail=%login%), then the user types in the email address that Active Directory has.
- User puts in a password and hits OK.
- ClearQuest connects to LDAP using what you put in #1 above.
- ClearQuest searches LDAP for this particular user based on the search criteria you put into #2. (So it’s checking the user exists and is in the right place before checking the password.)
- When ClearQuest finds that user, it checks to see if the password is correct.
- If the password is correct, ClearQuest compares the LDAP user’s field to the appropriate user record field in ClearQuest as you mapped in STEP 3.
- When the user passes this and is logged on, he/she finds a record and sets himself/herself as the owner. What does he pick on the drop-down list? The ClearQuest logon, which doesn’t have to look like anything already entered.
So, I don’t know why you would do this, but you could, for example, have the user log in using his/her network ID and then have CQ verify that the email address it is storing matches the one LDAP is storing.
Example
Say you have a CQ user called “john_martin” (currently user login_name). You want him to login using his network ID (jmxm253) and have CQ validate that the email address we have (test@test.com) is correct. If we wanted to make sure that jm253 could only log in if he’s in the ‘cq users’ group, you would make the following settings from the command line (this is also a good example of handling spaces):
1> installutil setldapinit mydbset admin “” “-h myprovider.mycompany.com -p 389 -D ‘CN=Service Account Five,DC=myprovider,DC=mycompany,DC=com’ -w SECRETWORD!”
2> installutil setldapsearch mydbset admin “” -s sub -b ‘OU=my users,DC=myprovider,DC=mycompany,DC=com’ ‘(&(objectCategory=person)(sAMAccountName=%login%)(memberOf=CN=cq users,OU=Security Groups,DC=myprovider,DC=mycompany,DC=com))’
3> installutil setcqldapmap mydbset admin “” CQ_EMAIL mail
Now, he’ll type in jm253/password to log in (CQ will see if that is his account name in LDAP and if he’s in the “my users” LDAP group), ClearQuest will make sure that LDAP’s email matches the one in ClearQuest, and any report of users (or drop-down field like owner) will use john_martin as the key. History, for example, will show that even though he used jmxm253 to log in, john_martin is the thing listed as the actor.
Also, he won’t be able to use john_martin to log into ClearQuest and you’ll have no idea what his network ID is. Do you care? If you care, but you’d like the unique user key to continue to be john_martin, then you can make CQ_MISC_INFO as the mapped field and map it to sAMAccountName.
There. I’ve used my own name about a million times. Thought ought to make me famous. Did it make the issue clearer or more muddy?