In our LDAP we have user attribute memberOf
witch indicates what groups a user is a member of. The value of memberOf
attribute represented by full group DN. Here is the example:
memberOf
= CN=PROJ_Admins_GeoNetwork,OU=PROJ,OU=Groups,OU=ORG,DC=org-it,DC=com
I want to set up GeoNetwork to automatically generate groups for user based on memberOf
value. Here is section for that in config-security-overrides.properties
:
# Map user information to LDAP attributes and default values
ldapUserContextMapper.mapping[name]=givenName,
ldapUserContextMapper.mapping[surname]=sn,
ldapUserContextMapper.mapping[mail]=mail,[email protected]
...↓
ldapUserContextMapper.mapping[privilege]=privileges,sample
ldapUserContextMapper.mapping[profile]=profile,RegisteredUser
I need to set: ldapUserContextMapper.mapping[privilege]={user's attribute with groups from LDAP},{default group name}
So I ended up with: ldapUserContextMapper.mapping[privilege]=memberOf,default_group
But the problem is that I don't want the entire value of memberOf
to be the name of created GN groups. I just need a part after CN=
and before ,OU=PROJ...
:
memberOf
= CN=PROJ_Admins_GeoNetwork,OU=PROJ,OU=Groups,OU=ORG,DC=org-it,DC=com
My question is: can I use regular expression or LDAP queries in the config-security-overrides.properties
and what should it be?