Skip to content

Commit d984adb

Browse files
Use constructor
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
1 parent 0208e45 commit d984adb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

config/src/main/java/org/springframework/security/config/authentication/AbstractUserDetailsServiceBeanDefinitionParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private String resolveId(Element element, AbstractBeanDefinition definition, Par
7474
id = pc.getReaderContext().generateBeanName(definition);
7575
}
7676
BeanDefinition container = pc.getContainingBeanDefinition();
77-
container.setAttribute("userDetailsService", new RuntimeBeanReference(id));
77+
container.getConstructorArgumentValues().addIndexedArgumentValue(0, new RuntimeBeanReference(id));
7878
}
7979
if (StringUtils.hasText(id)) {
8080
return id;

config/src/main/java/org/springframework/security/config/authentication/AuthenticationProviderBeanDefinitionParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public BeanDefinition parse(Element element, ParserContext pc) {
6464
+ "elements '" + Elements.USER_SERVICE + "', '" + Elements.JDBC_USER_SERVICE + "' or '"
6565
+ Elements.LDAP_USER_SERVICE + "'", element);
6666
}
67-
authProvider.setAttribute("userDetailsService", new RuntimeBeanReference(ref));
67+
authProvider.getConstructorArgumentValues().addIndexedArgumentValue(0, new RuntimeBeanReference(ref));
6868
}
6969
else {
7070
// Use the child elements to create the UserDetailsService

0 commit comments

Comments
 (0)