Browse Source

Added check for use of "ref" with other attributes in <authentication-provider>.

Luke Taylor 15 years ago
parent
commit
a4fd191499

+ 4 - 0
config/src/main/java/org/springframework/security/config/authentication/AuthenticationManagerBeanDefinitionParser.java

@@ -57,6 +57,10 @@ public class AuthenticationManagerBeanDefinitionParser implements BeanDefinition
             if (node instanceof Element) {
                 Element providerElt = (Element)node;
                 if (StringUtils.hasText(providerElt.getAttribute(ATT_REF))) {
+                    if (providerElt.getAttributes().getLength() > 1) {
+                        pc.getReaderContext().error("authentication-provider element cannot be used with other attributes " +
+                                "when using 'ref' attribute", pc.extractSource(element));
+                    }
                     NodeList providerChildren = providerElt.getChildNodes();
                     for (int j = 0; j < providerChildren.getLength(); j++) {
                         if (providerChildren.item(j) instanceof Element) {