mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-29 15:22:15 +00:00
SEC-890: Corrected use of dataSource property name in RememberMeBDP.
This commit is contained in:
parent
7d79ae5424
commit
af5f193ec1
@ -84,7 +84,7 @@ public class RememberMeBeanDefinitionParser implements BeanDefinitionParser {
|
|||||||
tokenRepo = new RuntimeBeanReference(tokenRepository);
|
tokenRepo = new RuntimeBeanReference(tokenRepository);
|
||||||
} else {
|
} else {
|
||||||
tokenRepo = new RootBeanDefinition(JdbcTokenRepositoryImpl.class);
|
tokenRepo = new RootBeanDefinition(JdbcTokenRepositoryImpl.class);
|
||||||
((BeanDefinition)tokenRepo).getPropertyValues().addPropertyValue(ATT_DATA_SOURCE,
|
((BeanDefinition)tokenRepo).getPropertyValues().addPropertyValue("dataSource",
|
||||||
new RuntimeBeanReference(dataSource));
|
new RuntimeBeanReference(dataSource));
|
||||||
}
|
}
|
||||||
services.getPropertyValues().addPropertyValue("tokenRepository", tokenRepo);
|
services.getPropertyValues().addPropertyValue("tokenRepository", tokenRepo);
|
||||||
|
@ -349,6 +349,21 @@ public class HttpSecurityBeanDefinitionParserTests {
|
|||||||
assertTrue(rememberMeServices instanceof PersistentTokenBasedRememberMeServices);
|
assertTrue(rememberMeServices instanceof PersistentTokenBasedRememberMeServices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void rememberMeServiceWorksWithDataSourceRef() {
|
||||||
|
setContext(
|
||||||
|
"<http auto-config='true'>" +
|
||||||
|
" <remember-me data-source-ref='ds'/>" +
|
||||||
|
"</http>" +
|
||||||
|
"<b:bean id='ds' class='org.springframework.security.TestDataSource'> " +
|
||||||
|
" <b:constructor-arg value='tokendb'/>" +
|
||||||
|
"</b:bean>" + AUTH_PROVIDER_XML);
|
||||||
|
Object rememberMeServices = appContext.getBean(BeanIds.REMEMBER_ME_SERVICES);
|
||||||
|
|
||||||
|
assertTrue(rememberMeServices instanceof PersistentTokenBasedRememberMeServices);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void rememberMeServiceWorksWithExternalServicesImpl() throws Exception {
|
public void rememberMeServiceWorksWithExternalServicesImpl() throws Exception {
|
||||||
setContext(
|
setContext(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user