(Apologies if I've got the terminology wrong, I'm fairly new to LDAP)
I am setting up a local LDAP server (Apache Directory Server) with the following structure:
o={my organization name} [objectClass=organization]
ou=groups [objectClass=organizationalUnit]
cn=someGroup [objectClass=groupOfUniqueNames]
cn=otherGroup [objectClass=groupOfUniqueNames]
...
ou=users [objectClass=organizationalUnit]
cn=user1 [objectClass=inetOrgPerson]
cn=user2 [objectClass=inetOrgPerson]
cn=user3 [objectClass=inetOrgPerson]
...
I also set up some basic authorization according to the manual.
Everything works great.
Now I have an issue. I have another server running Atlassian Crowd that needs access to this LDAP, and I would like to give that service its own LDAP authorization entry, to partition access rights. But it's not a user, it's a service.
What objectClass is used for service identities?
(and as a newbie to LDAP, how do you find out that groupOfUniqueNames is used for groups, inetOrgPerson is used for user entries? That seems to be the norm.)
Whatever you want, really. In order for Crowd (or anything else) to authenticate, you need a distinguished name somewhere in your tree and it needs to have a
userPassword
attribute.If you look at your schema (if you're using OpenLDAP, that's usually
/etc/openldap/schema
), you can find objectClasses that meet this criteria.The simplest is probably the
person
object class, the definition for which looks like this:That says that it requires the
sn
andcn
attributes, and may optionally have auserPassword
attribute (as well as a few others). So maybe you would add an entry like this:This presumes that you have a
serviceAccounts
OU where you will place this sort of thing, which is probably a good idea (because this clearly separates service accounts from user accounts).Crowd would authenticate as
cn=crowd,ou=serviceAccountrs,o=myOrganization
, and you would need to configure your LDAP directory to give this DN the appopriate access permissions.RFC 2256 / RFC 4519 recommends
objectClass: applicationProcess
for this sort of thing:Relevant attributes:
cn
(required),seeAlso
,ou
,l
, anddescription
(optional).One advantage of using
cn
instead ofuid
for the RDN is that service accounts won't be mistakenly matched as user accounts if you're using something likeldap_filter: (uid=%U)
as the user lookup query.I use object classes
account
(structural) andsimpleSecurityObject
(auxiliary) for service accounts. This way the service account has auid
and auserPassword
, both of which are good to have when doing authentication and authorization.