I have created a custom LdapUserDetailsMapper
class to map extended properties to a custom UserDetails
class that contains extra properties for things like displayName
, telephoneNumber
and department
to name a few. I managed to populate these properties by accessing the properties against the DirContextOperation
, i.e.
res.givenName = ctx.getStringAttribute("givenName");
I do not wish to hard-code this however and would like to have these properties configurable, which is fine, though I also want to use LDAP expressions to return a value resulting from that expression, i.e.
res.givenName = ctx.getStringAttribute("givenName + ' ' + sn");
This of course does not work. I could manually parse the pattern and retrieve the components prior to any concatenation but this sounds like work that I imagine the framework could already provide.