this.applicationPassword = applicationPassword.trim();
}
public SecurityComponents createSecurityComponents() {
// load the base configuration from the crowd-integration-client jar
XmlWebApplicationContext crowdConfigContext = new XmlWebApplicationContext();
crowdConfigContext.setClassLoader(getClass().getClassLoader());
/*
* crowdConfigContext .setConfigLocations(new String[] {
* "classpath:/applicationContext-HudsonCrowdClient.xml" });
*/
crowdConfigContext
.setConfigLocations(new String[] { "classpath:/applicationContext-CrowdClient.xml" });
crowdConfigContext.refresh();
// load the Hudson-Crowd configuration from Crowd.groovy
BeanBuilder builder = new BeanBuilder(crowdConfigContext, getClass().getClassLoader());
Binding binding = new Binding();
builder.parse(getClass().getResourceAsStream("Crowd.groovy"), binding);
WebApplicationContext context = builder.createApplicationContext();
// configure the ClientProperties object
if (applicationName != null || applicationPassword != null || url != null) {
Properties props = new Properties();
props.setProperty("application.name", applicationName);
props.setProperty("application.password", applicationPassword);
props.setProperty("crowd.server.url", url);
props.setProperty("session.validationinterval", "5");
ClientProperties clientProperties = (ClientProperties) crowdConfigContext
.getBean("clientProperties");
clientProperties.updateProperties(props);
} else {
log.warn("Client properties are incomplete");
}