}
ApplicationContext ctx =
WebApplicationContextUtils.getRequiredWebApplicationContext(context);
PasswordEncoder passwordEncoder = null;
try {
ProviderManager provider = (ProviderManager) ctx.getBean("org.springframework.security.authentication.ProviderManager#0");
for (Object o : provider.getProviders()) {
AuthenticationProvider p = (AuthenticationProvider) o;
if (p instanceof RememberMeAuthenticationProvider) {
config.put("rememberMeEnabled", Boolean.TRUE);
} else if (ctx.getBean("passwordEncoder") != null) {
passwordEncoder = (PasswordEncoder) ctx.getBean("passwordEncoder");
}
}
} catch (NoSuchBeanDefinitionException n) {
log.debug("authenticationManager bean not found, assuming test and ignoring...");
// ignore, should only happen when testing
}
context.setAttribute(Constants.CONFIG, config);
// output the retrieved values for the Init and Context Parameters
if (log.isDebugEnabled()) {
log.debug("Remember Me Enabled? " + config.get("rememberMeEnabled"));
if (passwordEncoder != null) {
log.debug("Password Encoder: " + passwordEncoder.getClass().getSimpleName());
}
log.debug("Populating drop-downs...");
}
setupContext(context);