use of com.emc.storageos.auth.ldap.StorageOSLdapAuthenticationHandler in project coprhd-controller by CoprHD.
the class ImmutableAuthenticationProviders method getLDAPProvider.
/**
* Add an LDAP authentication configuration
*
* @param authenticationConfiguration authentication provider config object
*/
private static AuthenticationProvider getLDAPProvider(CoordinatorClient coordinator, final AuthnProvider authenticationConfiguration, final DbClient dbclient) {
LdapServerList servers = createLdapServerList(coordinator, authenticationConfiguration, SystemPropertyUtil.getLdapConnectionTimeout(coordinator));
StorageOSLdapAuthenticationHandler authHandler = createLdapAuthenticationHandler(authenticationConfiguration, servers);
String[] returningAttributes = new String[] { StorageOSLdapPersonAttributeDao.COMMON_NAME, StorageOSLdapPersonAttributeDao.LDAP_DISTINGUISHED_NAME };
StorageOSLdapPersonAttributeDao attributeRepository = createLDAPAttributeRepository(dbclient, coordinator, authenticationConfiguration, servers, returningAttributes);
attributeRepository.setProviderType(ProvidersType.ldap);
// This is done here to differentiate with ActiveDirectory authn provider.
// If we do it in the common createLDAPAttributeRepository(), there is no way
// differentiate the AD and LDAP auth providers.
setGroupObjectClassesAndMemberAttributes(authenticationConfiguration, attributeRepository);
_log.debug("Adding LDAP mode auth handler to map");
return new AuthenticationProvider(authHandler, attributeRepository);
}
use of com.emc.storageos.auth.ldap.StorageOSLdapAuthenticationHandler in project coprhd-controller by CoprHD.
the class ImmutableAuthenticationProviders method getActiveDirectoryProvider.
/**
* Add an active directory authentication configuration
*
* @param authenticationConfiguration provider configuration object
* @param dbclient
*/
private static AuthenticationProvider getActiveDirectoryProvider(CoordinatorClient coordinator, final AuthnProvider authenticationConfiguration, DbClient dbclient) {
LdapServerList servers = createLdapServerList(coordinator, authenticationConfiguration, SystemPropertyUtil.getLdapConnectionTimeout(coordinator));
StorageOSLdapAuthenticationHandler authHandler = createLdapAuthenticationHandler(authenticationConfiguration, servers);
String[] returningAttributes = new String[] { StorageOSLdapPersonAttributeDao.COMMON_NAME, StorageOSLdapPersonAttributeDao.AD_DISTINGUISHED_NAME };
StorageOSLdapPersonAttributeDao attributeRepository = createLDAPAttributeRepository(dbclient, coordinator, authenticationConfiguration, servers, returningAttributes);
attributeRepository.setProviderType(ProvidersType.ad);
_log.debug("Adding AD mode auth handler to map");
return new AuthenticationProvider(authHandler, attributeRepository);
}
use of com.emc.storageos.auth.ldap.StorageOSLdapAuthenticationHandler in project coprhd-controller by CoprHD.
the class ImmutableAuthenticationProviders method createLdapAuthenticationHandler.
/**
* Create the authentication handler for this AD/LDAP configuration
*
* @param authenticationConfiguration AD/LDAP provider configuration
* @param servers AD/LDAP servers
* @return BindLdapAuthenticationHandler generated from configuration
* @throws Exception
*/
private static StorageOSLdapAuthenticationHandler createLdapAuthenticationHandler(final AuthnProvider authenticationConfiguration, LdapServerList servers) {
StorageOSLdapAuthenticationHandler authHandler = new StorageOSLdapAuthenticationHandler();
if (null == authenticationConfiguration.getSearchFilter()) {
throw APIException.badRequests.failedToCreateAuthenticationHandlerSearchFilterCannotBeNull(authenticationConfiguration.getId());
} else {
authHandler.setFilter(authenticationConfiguration.getSearchFilter());
}
if (null == authenticationConfiguration.getSearchBase()) {
throw APIException.badRequests.failedToCreateAuthenticationHandlerSearchBaseCannotBeNull(authenticationConfiguration.getId());
} else {
authHandler.setSearchBase(authenticationConfiguration.getSearchBase());
}
if (null == authenticationConfiguration.getDomains()) {
throw APIException.badRequests.failedToCreateAuthenticationHandlerDomainsCannotBeNull(authenticationConfiguration.getId());
} else {
authHandler.setDomains(authenticationConfiguration.getDomains());
}
authHandler.setLdapServers(servers);
return authHandler;
}
Aggregations