Browse Source

SEC-1653: Ensure UserDetailsServiceFactoryBean is registered using the tools API to prevent errors in STS.

Luke Taylor 14 years ago
parent
commit
6de2197c0f

+ 1 - 1
config/src/main/java/org/springframework/security/config/http/AuthenticationConfigBuilder.java

@@ -636,7 +636,7 @@ final class AuthenticationConfigBuilder {
         }
         RootBeanDefinition bean = new RootBeanDefinition(UserDetailsServiceFactoryBean.class);
         bean.setRole(BeanDefinition.ROLE_INFRASTRUCTURE);
-        pc.getReaderContext().getRegistry().registerBeanDefinition(BeanIds.USER_DETAILS_SERVICE_FACTORY, bean);
+        pc.registerBeanComponent(new BeanComponentDefinition(bean, BeanIds.USER_DETAILS_SERVICE_FACTORY));
     }
 
     List<OrderDecorator> getFilters() {