Release Notes / Version 10.2104
Table Of ContentsSpring ConfigurationProperties for UserProvider
The configuration for
UserProviders
used to reside in a separate file, typically named
jndi-\*.properties
. Now, the configuration has been migrated to Spring
ConfigurationProperties
, which simplifies deployment. The contentserver configuration already had a (List-valued) subgroup
cap.server.ldap
with two properties,
provider-class
and
properties
.
cap.server.ldap
has been renamed to
cap.server.userproviders
and features all the options you know from the old
jndi-*.properties
files, or from the property name constants in
LdapUserProvider
. Thus, you can configure a
UserProvider
completely in one place. The minimal configuration for a standard
ActiveDirectoryUserProvider
looks like this now:
cap.server.userproviders[0].provider-class=com.coremedia.ldap.ad.ActiveDirectoryUserProvider cap.server.userproviders[0].java.naming.security.principal=CN=Administrator,CN=Users,DC=acme,DC=com cap.server.userproviders[0].java.naming.security.credentials=secret cap.server.userproviders[0].ldap.host=activedirectory.acme.com cap.server.userproviders[0].ldap.base-distinguished-names[0]=CN=Users,DC=acme,DC=com
As you can see from the prefix, the properties have been renamed, and the property name constants in
LdapUserProvider
have been deleted. See the ConfigurationProperties class
com.coremedia.ldap.LdapUserProviderConfigurationProperties
for the new property names (you will easily recognize them), and
com.coremedia.ldap.JndiConfigurationProperties
for the supported
java.naming
properties.
Moreover, there is a generic Map-valued property
cap.server.userproviders#.properties
which can be used for (custom) properties that are not modeled explicitly by the ConfigurationProperties classes. In particular, you can use this Map to set additional
java.naming
properties that are not covered by
com.coremedia.ldap.JndiConfigurationProperties
, and the LdapUserProvider will propagate them to the JNDI framework. In
application.properties
notation, it would look like this:
cap.server.userproviders[0].properties[java.naming.language]=en
LdapUserProvider
and some subclasses had a constructor that took the
jndi-\*.properties
file as argument. These constructors have been deleted. They have never been used anyway, and they do not make sense any longer, since we abandoned the
jndi-\*.properties
files. If you have overridden this constructor in your own UserProvider, just delete it. Only the (implicit) NoArg constructor is used. The signature of
UserProvider#initialize
has changed: The argument used to be the
jndi-\*.properties
file URL, now it is the Map of generic properties mentioned above.
(CMS-16842)