SEC-1812: Replace assertion with warning message when overriding the global AuthenticationManager.

This commit is contained in:
Luke Taylor 2011-11-02 14:23:59 +00:00
parent 8e1d407e3e
commit 3b13a3fb25
1 changed files with 3 additions and 2 deletions

View File

@ -41,8 +41,9 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
String id = element.getAttribute("id");
if (!StringUtils.hasText(id)) {
Assert.state(!pc.getRegistry().containsBeanDefinition(BeanIds.AUTHENTICATION_MANAGER),
"Global AuthenticationManager has already been registered!");
if (pc.getRegistry().containsBeanDefinition(BeanIds.AUTHENTICATION_MANAGER)) {
pc.getReaderContext().warning("Overriding globally registered AuthenticationManager", pc.extractSource(element));
}
id = BeanIds.AUTHENTICATION_MANAGER;
}
pc.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), pc.extractSource(element)));