SEC-1812: Replace assertion with warning message when overriding the global AuthenticationManager.
This commit is contained in:
parent
8e1d407e3e
commit
3b13a3fb25
|
@ -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)));
|
||||
|
|
Loading…
Reference in New Issue