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));
}
Aggregations