I'm trying to add a custom attribute to my openldap structure, to store the role for each user for later handling of my spring web application users.
There are only 3 roles: admin, manager and viewer. Is it possible to add any rule for this?
And how to fix the below mentioned error?
# CUSTOM ATTRIBUTE
dn: cn=schema,cn=config
changeType: modify
add: attributeTypes
attributeTypes: (
2.25.128424792425578037463837247958458780603.1
NAME 'role'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
)
-
add: objectClasses
objectClasses: (
2.25.128424792425578037463837247958458780603.2
NAME 'rolePerson'
SUP person
AUXILIARY
MUST ( role )
)
# USERS
dn: ou=people,dc=ubuntu,dc=local
objectClass: organizationalUnit
ou: people
dn: cn=demo_admin,ou=people,dc=ubuntu,dc=local
objectClass: rolePerson
userPassword: {MD5}fe01ce2a7fbac8fafaed7c982a04e229
uid: demo
cn: demo
sn: demo
role: admin
Output of ldapadd -x -W -D "cn=admin,dc=ubuntu,dc=local" -f roleuser.ldif:
modifying entry "cn=schema,cn=config"
ldap_modify: Invalid syntax (21)
additional info: attributeTypes: value #0 invalid per syntax