I use Spring Data LDAP and Spring Boot provides out of the box support for an embedded UnboundID server. However, when I use Spring Data LDAP's @Entry
annotation, I need to specify a different base
in the annotation based on whether I'm using the embedded UnboundID LDAP server, or a remote Active Directory server.
I was attempting to do this with SpEL and profile-based properties by specifying:
@Entry(base = "${ldap.person.base}", ...)
Then I have an application.propreties
with ldap.person.base=OU=AD Person Base
and an application-embedded.properties
with ldap.person.base=OU=Embedded Person Base
.
However, the @Entry
annotation does not seem to support SpEL evaluation:
javax.naming.InvalidNameException: Invalid name: ${ldap.person.base}
There is an open issue in Spring LDAP to add support for this, but is there any workaround or some other way I can accomplish this until it is supported in Spring LDAP?