|
@@ -1,8 +1,11 @@
|
|
package org.springframework.security.config.authentication;
|
|
package org.springframework.security.config.authentication;
|
|
|
|
|
|
|
|
+import static org.junit.Assert.*;
|
|
|
|
+
|
|
import org.junit.Test;
|
|
import org.junit.Test;
|
|
import org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException;
|
|
import org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException;
|
|
import org.springframework.context.support.AbstractXmlApplicationContext;
|
|
import org.springframework.context.support.AbstractXmlApplicationContext;
|
|
|
|
+import org.springframework.security.authentication.AuthenticationProvider;
|
|
import org.springframework.security.authentication.concurrent.ConcurrentSessionControllerImpl;
|
|
import org.springframework.security.authentication.concurrent.ConcurrentSessionControllerImpl;
|
|
import org.springframework.security.authentication.concurrent.SessionRegistryImpl;
|
|
import org.springframework.security.authentication.concurrent.SessionRegistryImpl;
|
|
import org.springframework.security.config.BeanIds;
|
|
import org.springframework.security.config.BeanIds;
|
|
@@ -23,6 +26,20 @@ public class AuthenticationManagerBeanDefinitionParserTests {
|
|
" </b:property>" +
|
|
" </b:property>" +
|
|
"</b:bean>";
|
|
"</b:bean>";
|
|
|
|
|
|
|
|
+ @Test
|
|
|
|
+ // SEC-1225
|
|
|
|
+ public void providersAreRegisteredAsTopLevelBeans() throws Exception {
|
|
|
|
+ setContext(
|
|
|
|
+ "<authentication-manager>" +
|
|
|
|
+ " <authentication-provider>" +
|
|
|
|
+ " <user-service>" +
|
|
|
|
+ " <user name='bob' password='bobspassword' authorities='ROLE_A,ROLE_B' />" +
|
|
|
|
+ " </user-service>" +
|
|
|
|
+ " </authentication-provider>" +
|
|
|
|
+ "</authentication-manager>" + SESSION_CONTROLLER, "3.0");
|
|
|
|
+ assertEquals(1, appContext.getBeansOfType(AuthenticationProvider.class).size());
|
|
|
|
+ }
|
|
|
|
+
|
|
@Test(expected=XmlBeanDefinitionStoreException.class)
|
|
@Test(expected=XmlBeanDefinitionStoreException.class)
|
|
public void sessionControllerRefAttributeIsRejectedFor30Context() throws Exception {
|
|
public void sessionControllerRefAttributeIsRejectedFor30Context() throws Exception {
|
|
setContext(
|
|
setContext(
|