Search in sources :

Example 1 with LdapTemplate

use of org.acegisecurity.ldap.LdapTemplate in project hudson-2.x by hudson.

the class LDAPSecurityRealm method createSecurityComponents.

public SecurityComponents createSecurityComponents() {
    Binding binding = new Binding();
    binding.setVariable("instance", this);
    BeanBuilder builder = new BeanBuilder();
    builder.parse(Hudson.getInstance().servletContext.getResourceAsStream("/WEB-INF/security/LDAPBindSecurityRealm.groovy"), binding);
    WebApplicationContext appContext = builder.createApplicationContext();
    ldapTemplate = new LdapTemplate(findBean(InitialDirContextFactory.class, appContext));
    return new SecurityComponents(findBean(AuthenticationManager.class, appContext), new LDAPUserDetailsService(appContext));
}
Also used : Binding(groovy.lang.Binding) BeanBuilder(hudson.util.spring.BeanBuilder) AuthenticationManager(org.acegisecurity.AuthenticationManager) LdapTemplate(org.acegisecurity.ldap.LdapTemplate) WebApplicationContext(org.springframework.web.context.WebApplicationContext)

Aggregations

Binding (groovy.lang.Binding)1 BeanBuilder (hudson.util.spring.BeanBuilder)1 AuthenticationManager (org.acegisecurity.AuthenticationManager)1 LdapTemplate (org.acegisecurity.ldap.LdapTemplate)1 WebApplicationContext (org.springframework.web.context.WebApplicationContext)1