rbacManagerChanged || ( redbackRuntimeConfiguration.getRbacManagerImpls().toString().hashCode()
!= redbackRuntimeConfigurationAdmin.getRedbackRuntimeConfiguration().getRbacManagerImpls().toString().hashCode() );
+ boolean ldapConfigured = false;
+ for (String um : redbackRuntimeConfiguration.getUserManagerImpls()) {
+ if (um.contains("ldap")) {
+ ldapConfigured=true;
+ }
+ }
+ if (!ldapConfigured) {
+ for (String rbm : redbackRuntimeConfiguration.getRbacManagerImpls()) {
+ if (rbm.contains("ldap")) {
+ ldapConfigured = true;
+ }
+ }
+ }
+
redbackRuntimeConfigurationAdmin.updateRedbackRuntimeConfiguration( redbackRuntimeConfiguration );
if ( userManagerChanged )
roleManager.initialize();
}
- ldapConnectionFactory.initialize();
-
+ if (ldapConfigured) {
+ try {
+ ldapConnectionFactory.initialize();
+ } catch (Exception e) {
+ ArchivaRestServiceException newEx = new ArchivaRestServiceException(e.getMessage(), e);
+ newEx.setErrorKey("error.ldap.connectionFactory.init.failed");
+ throw newEx;
+ }
+ }
Collection<PasswordRule> passwordRules = applicationContext.getBeansOfType( PasswordRule.class ).values();
for ( PasswordRule passwordRule : passwordRules )
usersCache.setMaxElementsOnDisk(
redbackRuntimeConfiguration.getUsersCacheConfiguration().getMaxElementsOnDisk() );
- ldapUserMapper.initialize();
+ if (ldapConfigured) {
+ try {
+ ldapUserMapper.initialize();
+ } catch (Exception e) {
+ ArchivaRestServiceException newEx = new ArchivaRestServiceException(e.getMessage(), e);
+ newEx.setErrorKey("error.ldap.userMapper.init.failed");
+ throw newEx;
+ }
+ }
//check repositories roles are here !!!
return Boolean.TRUE;
}
- catch ( Exception e )
+ catch (ArchivaRestServiceException e) {
+ log.error(e.getMessage(), e);
+ throw e;
+ } catch ( Exception e )
{
log.error( e.getMessage(), e );
- throw new ArchivaRestServiceException( e.getMessage(), e );
+ throw new ArchivaRestServiceException(e.getMessage(), e);
}
}
redback-runtime-configuration.updated=Redback Runtime Configuration updated.
archiva.redback.usermanager.ldap=LDAP User Manager
archiva.redback.usermanager.jdo=Database User Manager
+archiva.redback.usermanager.jpa=Database JPA User Manager
redback.runtime.properties.help.title=Property Description
security.policy.password.rule.alphacount.enabled.help.content=Minimum of letter characters in the password.
security.policy.password.rule.reuse.enabled.help.content=Prevent reuse of previous passwords.
archiva.redback.rbacmanager.ldap=LDAP RBac Manager
archiva.redback.rbacmanager.jdo=Database RBac Manager
+archiva.redback.rbackmanager.jpa=Database JPA RBac Manager
archiva.redback.rbacmanager.cached=Cached RBac Manager
redback.runtime.rbac-managers.impls.chose=RbacManager(s) chosen
redback.runtime.rbac-managers.impls.available=Available RbacManagers
navigation.first=First
navigation.last=Last
+# Error messages for LDAP configuration
+error.ldap.connectionFactory.init.failed=Could not initialize LDAP connection factory. Check your LDAP configuration.
+error.ldap.userMapper.init.failed=Could not initialize LDAP user mapper. Check your LDAP configuration.