Search in sources :

Example 1 with LdapContextSourceConfigurator

use of com.thoughtworks.go.server.security.LdapContextSourceConfigurator in project gocd by gocd.

the class ServerConfigService method ldapContextSource.

DefaultSpringSecurityContextSource ldapContextSource(LdapConfig ldapConfig) {
    DefaultSpringSecurityContextSource source = new DefaultSpringSecurityContextSource(ldapConfig.uri());
    //so user can define the variable java.naming.referral=follow in the server.sh
    source.setBaseEnvironmentProperties(System.getProperties());
    new LdapContextSourceConfigurator(ldapConfig).configure(source);
    try {
        source.afterPropertiesSet();
    } catch (Exception e) {
        bomb("Cannot create ldap context", e);
    }
    return source;
}
Also used : DefaultSpringSecurityContextSource(org.springframework.security.ldap.DefaultSpringSecurityContextSource) LdapContextSourceConfigurator(com.thoughtworks.go.server.security.LdapContextSourceConfigurator) URISyntaxException(java.net.URISyntaxException) AddressException(javax.mail.internet.AddressException)

Aggregations

LdapContextSourceConfigurator (com.thoughtworks.go.server.security.LdapContextSourceConfigurator)1 URISyntaxException (java.net.URISyntaxException)1 AddressException (javax.mail.internet.AddressException)1 DefaultSpringSecurityContextSource (org.springframework.security.ldap.DefaultSpringSecurityContextSource)1