SEC-107: Finalize rename of AuthenticationDao to UserDetailsService with corresponding change in package from .providers.dao to .userdetails.

This commit is contained in:
Ben Alex 2005-11-30 00:20:13 +00:00
parent dd99fae8e1
commit 62fde4ede3
31 changed files with 138 additions and 138 deletions

View File

@ -24,7 +24,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLES_IGNORED_BY_CAS marissa=koala,ROLES_IGNORED_BY_CAS
@ -36,7 +36,7 @@
</bean> </bean>
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">

View File

@ -20,7 +20,7 @@
<beans> <beans>
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -32,7 +32,7 @@
</bean> </bean>
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">

View File

@ -20,7 +20,7 @@
<beans> <beans>
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -32,7 +32,7 @@
</bean> </bean>
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"> <bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
<property name="forcePrincipalAsString"><value>true</value></property> <property name="forcePrincipalAsString"><value>true</value></property>
</bean> </bean>

View File

@ -41,24 +41,24 @@ public class DaoCasAuthoritiesPopulator implements CasAuthoritiesPopulator,
InitializingBean { InitializingBean {
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
//~ Methods ================================================================ //~ Methods ================================================================
public void setAuthenticationDao(UserDetailsService authenticationDao) { public void setUserDetailsService(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
public UserDetailsService getAuthenticationDao() { public UserDetailsService getUserDetailsService() {
return authenticationDao; return userDetailsService;
} }
public UserDetails getUserDetails(String casUserId) public UserDetails getUserDetails(String casUserId)
throws AuthenticationException { throws AuthenticationException {
return this.authenticationDao.loadUserByUsername(casUserId); return this.userDetailsService.loadUserByUsername(casUserId);
} }
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
Assert.notNull(this.authenticationDao, "An authenticationDao must be set"); Assert.notNull(this.userDetailsService, "An authenticationDao must be set");
} }
} }

View File

@ -40,7 +40,7 @@ public class DaoAuthenticationProvider
extends AbstractUserDetailsAuthenticationProvider { extends AbstractUserDetailsAuthenticationProvider {
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder(); private PasswordEncoder passwordEncoder = new PlaintextPasswordEncoder();
private SaltSource saltSource; private SaltSource saltSource;
private boolean hideUserNotFoundExceptions = true; private boolean hideUserNotFoundExceptions = true;
@ -65,12 +65,12 @@ public class DaoAuthenticationProvider
} }
protected void doAfterPropertiesSet() throws Exception { protected void doAfterPropertiesSet() throws Exception {
Assert.notNull(this.authenticationDao, Assert.notNull(this.userDetailsService,
"An Authentication DAO must be set"); "An Authentication DAO must be set");
} }
public UserDetailsService getAuthenticationDao() { public UserDetailsService getUserDetailsService() {
return authenticationDao; return userDetailsService;
} }
public PasswordEncoder getPasswordEncoder() { public PasswordEncoder getPasswordEncoder() {
@ -91,7 +91,7 @@ public class DaoAuthenticationProvider
UserDetails loadedUser; UserDetails loadedUser;
try { try {
loadedUser = this.authenticationDao.loadUserByUsername(username); loadedUser = this.userDetailsService.loadUserByUsername(username);
} catch (UsernameNotFoundException notFound) { } catch (UsernameNotFoundException notFound) {
if (hideUserNotFoundExceptions) { if (hideUserNotFoundExceptions) {
throw new BadCredentialsException(messages.getMessage( throw new BadCredentialsException(messages.getMessage(
@ -113,8 +113,8 @@ public class DaoAuthenticationProvider
return loadedUser; return loadedUser;
} }
public void setAuthenticationDao(UserDetailsService authenticationDao) { public void setUserDetailsService(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
/** /**

View File

@ -50,7 +50,7 @@ public class DaoX509AuthoritiesPopulator implements X509AuthoritiesPopulator,
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
protected MessageSourceAccessor messages; protected MessageSourceAccessor messages;
private Pattern subjectDNPattern; private Pattern subjectDNPattern;
private String subjectDNRegex = "CN=(.*?),"; private String subjectDNRegex = "CN=(.*?),";
@ -58,7 +58,7 @@ public class DaoX509AuthoritiesPopulator implements X509AuthoritiesPopulator,
//~ Methods ================================================================ //~ Methods ================================================================
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
Assert.notNull(authenticationDao, "An authenticationDao must be set"); Assert.notNull(userDetailsService, "An authenticationDao must be set");
Assert.notNull(this.messages, "A message source must be set"); Assert.notNull(this.messages, "A message source must be set");
Perl5Compiler compiler = new Perl5Compiler(); Perl5Compiler compiler = new Perl5Compiler();
@ -94,11 +94,11 @@ public class DaoX509AuthoritiesPopulator implements X509AuthoritiesPopulator,
String userName = match.group(1); String userName = match.group(1);
return this.authenticationDao.loadUserByUsername(userName); return this.userDetailsService.loadUserByUsername(userName);
} }
public void setAuthenticationDao(UserDetailsService authenticationDao) { public void setUserDetailsService(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
public void setMessageSource(MessageSource messageSource) { public void setMessageSource(MessageSource messageSource) {

View File

@ -120,7 +120,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
private DigestProcessingFilterEntryPoint authenticationEntryPoint; private DigestProcessingFilterEntryPoint authenticationEntryPoint;
protected MessageSourceAccessor messages; protected MessageSourceAccessor messages;
private UserCache userCache = new NullUserCache(); private UserCache userCache = new NullUserCache();
@ -129,7 +129,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
//~ Methods ================================================================ //~ Methods ================================================================
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
Assert.notNull(authenticationDao, "An AuthenticationDao is required"); Assert.notNull(userDetailsService, "An AuthenticationDao is required");
Assert.notNull(authenticationEntryPoint, Assert.notNull(authenticationEntryPoint,
"A DigestProcessingFilterEntryPoint is required"); "A DigestProcessingFilterEntryPoint is required");
} }
@ -288,7 +288,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
loadedFromDao = true; loadedFromDao = true;
try { try {
user = authenticationDao.loadUserByUsername(username); user = userDetailsService.loadUserByUsername(username);
} catch (UsernameNotFoundException notFound) { } catch (UsernameNotFoundException notFound) {
fail(request, response, fail(request, response,
new BadCredentialsException(messages.getMessage( new BadCredentialsException(messages.getMessage(
@ -324,7 +324,7 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
} }
try { try {
user = authenticationDao.loadUserByUsername(username); user = userDetailsService.loadUserByUsername(username);
} catch (UsernameNotFoundException notFound) { } catch (UsernameNotFoundException notFound) {
// Would very rarely happen, as user existed earlier // Would very rarely happen, as user existed earlier
fail(request, response, fail(request, response,
@ -460,8 +460,8 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
return digestMd5; return digestMd5;
} }
public UserDetailsService getAuthenticationDao() { public UserDetailsService getUserDetailsService() {
return authenticationDao; return userDetailsService;
} }
public DigestProcessingFilterEntryPoint getAuthenticationEntryPoint() { public DigestProcessingFilterEntryPoint getAuthenticationEntryPoint() {
@ -474,8 +474,8 @@ public class DigestProcessingFilter implements Filter, InitializingBean,
public void init(FilterConfig ignored) throws ServletException {} public void init(FilterConfig ignored) throws ServletException {}
public void setAuthenticationDao(UserDetailsService authenticationDao) { public void setUserDetailsService(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
public void setAuthenticationEntryPoint( public void setAuthenticationEntryPoint(

View File

@ -112,19 +112,19 @@ public class TokenBasedRememberMeServices implements RememberMeServices,
//~ Instance fields ======================================================== //~ Instance fields ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
private String key; private String key;
private String parameter = DEFAULT_PARAMETER; private String parameter = DEFAULT_PARAMETER;
private long tokenValiditySeconds = 1209600; // 14 days private long tokenValiditySeconds = 1209600; // 14 days
//~ Methods ================================================================ //~ Methods ================================================================
public void setAuthenticationDao(UserDetailsService authenticationDao) { public void setUserDetailsService(UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
public UserDetailsService getAuthenticationDao() { public UserDetailsService getUserDetailsService() {
return authenticationDao; return userDetailsService;
} }
public void setKey(String key) { public void setKey(String key) {
@ -154,7 +154,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices,
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() throws Exception {
Assert.hasLength(key); Assert.hasLength(key);
Assert.hasLength(parameter); Assert.hasLength(parameter);
Assert.notNull(authenticationDao); Assert.notNull(userDetailsService);
} }
public Authentication autoLogin(HttpServletRequest request, public Authentication autoLogin(HttpServletRequest request,
@ -212,7 +212,7 @@ public class TokenBasedRememberMeServices implements RememberMeServices,
UserDetails userDetails; UserDetails userDetails;
try { try {
userDetails = this.authenticationDao userDetails = this.userDetailsService
.loadUserByUsername(cookieTokens[0]); .loadUserByUsername(cookieTokens[0]);
} catch (UsernameNotFoundException notFound) { } catch (UsernameNotFoundException notFound) {
cancelCookie(request, response, cancelCookie(request, response,

View File

@ -131,7 +131,7 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean,
// ~ Instance fields // ~ Instance fields
// ======================================================== // ========================================================
private UserDetailsService authenticationDao; private UserDetailsService userDetailsService;
protected MessageSourceAccessor messages; protected MessageSourceAccessor messages;
private String exitUserUrl = "/j_acegi_exit_user"; private String exitUserUrl = "/j_acegi_exit_user";
private String switchUserUrl = "/j_acegi_switch_user"; private String switchUserUrl = "/j_acegi_switch_user";
@ -143,7 +143,7 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean,
Assert.hasLength(switchUserUrl, "switchUserUrl must be specified"); Assert.hasLength(switchUserUrl, "switchUserUrl must be specified");
Assert.hasLength(exitUserUrl, "exitUserUrl must be specified"); Assert.hasLength(exitUserUrl, "exitUserUrl must be specified");
Assert.hasLength(targetUrl, "targetUrl must be specified"); Assert.hasLength(targetUrl, "targetUrl must be specified");
Assert.notNull(authenticationDao, "authenticationDao must be specified"); Assert.notNull(userDetailsService, "authenticationDao must be specified");
Assert.notNull(messages, "A message source must be set"); Assert.notNull(messages, "A message source must be set");
} }
@ -235,7 +235,7 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean,
} }
// load the user by name // load the user by name
UserDetails targetUser = this.authenticationDao UserDetails targetUser = this.userDetailsService
.loadUserByUsername(username); .loadUserByUsername(username);
// user not found // user not found
@ -491,9 +491,9 @@ public class SwitchUserProcessingFilter implements Filter, InitializingBean,
* @param authenticationDao The * @param authenticationDao The
* authentication dao * authentication dao
*/ */
public void setAuthenticationDao( public void setUserDetailsService(
UserDetailsService authenticationDao) { UserDetailsService authenticationDao) {
this.authenticationDao = authenticationDao; this.userDetailsService = authenticationDao;
} }
/** /**

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
<property name="forcePrincipalAsString"><value>true</value></property> <property name="forcePrincipalAsString"><value>true</value></property>
</bean> </bean>

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
<property name="forcePrincipalAsString"><value>true</value></property> <property name="forcePrincipalAsString"><value>true</value></property>
</bean> </bean>

View File

@ -18,13 +18,13 @@
</bean> </bean>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="jdbcDaoImpl" class="org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl"> <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property> <property name="dataSource"><ref bean="dataSource"/></property>
</bean> </bean>
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref bean="jdbcDaoImpl"/></property>
</bean> </bean>
<!-- The authentication manager that iterates through our only authentication provider --> <!-- The authentication manager that iterates through our only authentication provider -->

View File

@ -70,7 +70,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
public void testGetGrantedAuthoritiesForInvalidUsername() public void testGetGrantedAuthoritiesForInvalidUsername()
throws Exception { throws Exception {
DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator(); DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator();
populator.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); populator.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
populator.afterPropertiesSet(); populator.afterPropertiesSet();
try { try {
@ -84,7 +84,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
public void testGetGrantedAuthoritiesForValidUsername() public void testGetGrantedAuthoritiesForValidUsername()
throws Exception { throws Exception {
DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator(); DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator();
populator.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); populator.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
populator.afterPropertiesSet(); populator.afterPropertiesSet();
UserDetails results = populator.getUserDetails("marissa"); UserDetails results = populator.getUserDetails("marissa");
@ -98,7 +98,7 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
public void testGetGrantedAuthoritiesWhenDaoThrowsException() public void testGetGrantedAuthoritiesWhenDaoThrowsException()
throws Exception { throws Exception {
DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator(); DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator();
populator.setAuthenticationDao(new MockAuthenticationDaoSimulateBackendError()); populator.setUserDetailsService(new MockAuthenticationDaoSimulateBackendError());
populator.afterPropertiesSet(); populator.afterPropertiesSet();
try { try {
@ -112,8 +112,8 @@ public class DaoCasAuthoritiesPopulatorTests extends TestCase {
public void testGettersSetters() { public void testGettersSetters() {
DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator(); DaoCasAuthoritiesPopulator populator = new DaoCasAuthoritiesPopulator();
UserDetailsService dao = new MockAuthenticationDaoUserMarissa(); UserDetailsService dao = new MockAuthenticationDaoUserMarissa();
populator.setAuthenticationDao(dao); populator.setUserDetailsService(dao);
assertEquals(dao, populator.getAuthenticationDao()); assertEquals(dao, populator.getUserDetailsService());
} }
//~ Inner Classes ========================================================== //~ Inner Classes ==========================================================

View File

@ -68,7 +68,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -85,7 +85,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserPeterAccountExpired()); provider.setUserDetailsService(new MockAuthenticationDaoUserPeterAccountExpired());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -102,7 +102,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserPeterAccountLocked()); provider.setUserDetailsService(new MockAuthenticationDaoUserPeterAccountLocked());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -119,7 +119,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserPeterCredentialsExpired()); provider.setUserDetailsService(new MockAuthenticationDaoUserPeterCredentialsExpired());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -147,7 +147,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserPeter()); provider.setUserDetailsService(new MockAuthenticationDaoUserPeter());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -164,7 +164,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoSimulateBackendError()); provider.setUserDetailsService(new MockAuthenticationDaoSimulateBackendError());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -181,7 +181,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -198,7 +198,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -216,7 +216,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setHideUserNotFoundExceptions(false); // we want UsernameNotFoundExceptions provider.setHideUserNotFoundExceptions(false); // we want UsernameNotFoundExceptions
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -234,7 +234,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
assertTrue(provider.isHideUserNotFoundExceptions()); assertTrue(provider.isHideUserNotFoundExceptions());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -251,7 +251,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
try { try {
@ -269,7 +269,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
Authentication result = provider.authenticate(token); Authentication result = provider.authenticate(token);
@ -293,7 +293,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
Authentication result = provider.authenticate(token); Authentication result = provider.authenticate(token);
@ -323,7 +323,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissaWithSalt()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissaWithSalt());
provider.setSaltSource(salt); provider.setSaltSource(salt);
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
@ -349,7 +349,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
provider.setForcePrincipalAsString(true); provider.setForcePrincipalAsString(true);
@ -371,7 +371,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoReturnsNull()); provider.setUserDetailsService(new MockAuthenticationDaoReturnsNull());
try { try {
provider.authenticate(token); provider.authenticate(token);
@ -410,7 +410,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
MockUserCache cache = new MockUserCache(); MockUserCache cache = new MockUserCache();
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(authenticationDao); provider.setUserDetailsService(authenticationDao);
provider.setUserCache(cache); provider.setUserCache(cache);
// This will work, as password still "koala" // This will work, as password still "koala"
@ -449,7 +449,7 @@ public class DaoAuthenticationProviderTests extends TestCase {
public void testStartupFailsIfNoUserCacheSet() throws Exception { public void testStartupFailsIfNoUserCacheSet() throws Exception {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
provider.setAuthenticationDao(new MockAuthenticationDaoUserMarissa()); provider.setUserDetailsService(new MockAuthenticationDaoUserMarissa());
assertEquals(NullUserCache.class, provider.getUserCache().getClass()); assertEquals(NullUserCache.class, provider.getUserCache().getClass());
provider.setUserCache(null); provider.setUserCache(null);
@ -465,9 +465,9 @@ public class DaoAuthenticationProviderTests extends TestCase {
DaoAuthenticationProvider provider = new DaoAuthenticationProvider(); DaoAuthenticationProvider provider = new DaoAuthenticationProvider();
provider.setMessageSource(new StaticMessageSource()); provider.setMessageSource(new StaticMessageSource());
UserDetailsService dao = new MockAuthenticationDaoUserMarissa(); UserDetailsService dao = new MockAuthenticationDaoUserMarissa();
provider.setAuthenticationDao(dao); provider.setUserDetailsService(dao);
provider.setUserCache(new MockUserCache()); provider.setUserCache(new MockUserCache());
assertEquals(dao, provider.getAuthenticationDao()); assertEquals(dao, provider.getUserDetailsService());
provider.afterPropertiesSet(); provider.afterPropertiesSet();
assertTrue(true); assertTrue(true);
} }

View File

@ -59,7 +59,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator(); DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator();
populator.setMessageSource(new StaticMessageSource()); populator.setMessageSource(new StaticMessageSource());
populator.setAuthenticationDao(new MockAuthenticationDaoMatchesNameOrEmail()); populator.setUserDetailsService(new MockAuthenticationDaoMatchesNameOrEmail());
populator.afterPropertiesSet(); populator.afterPropertiesSet();
populator.getUserDetails(cert); populator.getUserDetails(cert);
} }
@ -69,7 +69,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator(); DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator();
populator.setMessageSource(new StaticMessageSource()); populator.setMessageSource(new StaticMessageSource());
populator.setAuthenticationDao(new MockAuthenticationDaoMatchesNameOrEmail()); populator.setUserDetailsService(new MockAuthenticationDaoMatchesNameOrEmail());
populator.setSubjectDNRegex("emailAddress=(.*?),"); populator.setSubjectDNRegex("emailAddress=(.*?),");
populator.afterPropertiesSet(); populator.afterPropertiesSet();
populator.getUserDetails(cert); populator.getUserDetails(cert);
@ -78,7 +78,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
public void testInvalidRegexFails() throws Exception { public void testInvalidRegexFails() throws Exception {
DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator(); DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator();
populator.setMessageSource(new StaticMessageSource()); populator.setMessageSource(new StaticMessageSource());
populator.setAuthenticationDao(new MockAuthenticationDaoMatchesNameOrEmail()); populator.setUserDetailsService(new MockAuthenticationDaoMatchesNameOrEmail());
populator.setSubjectDNRegex("CN=(.*?,"); // missing closing bracket on group populator.setSubjectDNRegex("CN=(.*?,"); // missing closing bracket on group
try { try {
@ -94,7 +94,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator(); DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator();
populator.setMessageSource(new StaticMessageSource()); populator.setMessageSource(new StaticMessageSource());
populator.setAuthenticationDao(new MockAuthenticationDaoMatchesNameOrEmail()); populator.setUserDetailsService(new MockAuthenticationDaoMatchesNameOrEmail());
populator.setSubjectDNRegex("shoeSize=(.*?),"); populator.setSubjectDNRegex("shoeSize=(.*?),");
populator.afterPropertiesSet(); populator.afterPropertiesSet();
@ -111,7 +111,7 @@ public class DaoX509AuthoritiesPopulatorTests extends TestCase {
DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator(); DaoX509AuthoritiesPopulator populator = new DaoX509AuthoritiesPopulator();
populator.setMessageSource(new StaticMessageSource()); populator.setMessageSource(new StaticMessageSource());
populator.setAuthenticationDao(new MockAuthenticationDaoMatchesNameOrEmail()); populator.setUserDetailsService(new MockAuthenticationDaoMatchesNameOrEmail());
populator.setSubjectDNRegex("CN=.*?,"); populator.setSubjectDNRegex("CN=.*?,");
populator.afterPropertiesSet(); populator.afterPropertiesSet();

View File

@ -184,8 +184,8 @@ public class DigestProcessingFilterTests extends TestCase {
public void testGettersSetters() { public void testGettersSetters() {
DigestProcessingFilter filter = new DigestProcessingFilter(); DigestProcessingFilter filter = new DigestProcessingFilter();
filter.setAuthenticationDao(new MockAuthenticationDao()); filter.setUserDetailsService(new MockAuthenticationDao());
assertTrue(filter.getAuthenticationDao() != null); assertTrue(filter.getUserDetailsService() != null);
filter.setAuthenticationEntryPoint(new DigestProcessingFilterEntryPoint()); filter.setAuthenticationEntryPoint(new DigestProcessingFilterEntryPoint());
assertTrue(filter.getAuthenticationEntryPoint() != null); assertTrue(filter.getAuthenticationEntryPoint() != null);
@ -564,7 +564,7 @@ public class DigestProcessingFilterTests extends TestCase {
throws Exception { throws Exception {
try { try {
DigestProcessingFilter filter = new DigestProcessingFilter(); DigestProcessingFilter filter = new DigestProcessingFilter();
filter.setAuthenticationDao(new MockAuthenticationDao()); filter.setUserDetailsService(new MockAuthenticationDao());
filter.afterPropertiesSet(); filter.afterPropertiesSet();
fail("Should have thrown IllegalArgumentException"); fail("Should have thrown IllegalArgumentException");
} catch (IllegalArgumentException expected) { } catch (IllegalArgumentException expected) {

View File

@ -70,7 +70,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
throws Exception { throws Exception {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(null, true)); services.setUserDetailsService(new MockAuthenticationDao(null, true));
services.afterPropertiesSet(); services.afterPropertiesSet();
MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletRequest request = new MockHttpServletRequest();
@ -89,7 +89,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
throws Exception { throws Exception {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(null, true)); services.setUserDetailsService(new MockAuthenticationDao(null, true));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie("unrelated_cookie", "foobar"); Cookie cookie = new Cookie("unrelated_cookie", "foobar");
@ -112,7 +112,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -139,7 +139,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -164,7 +164,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -190,7 +190,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -217,7 +217,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -239,7 +239,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
public void testAutoLoginIfUserNotFound() throws Exception { public void testAutoLoginIfUserNotFound() throws Exception {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(null, true)); services.setUserDetailsService(new MockAuthenticationDao(null, true));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -265,7 +265,7 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setKey("key"); services.setKey("key");
services.setAuthenticationDao(new MockAuthenticationDao(user, false)); services.setUserDetailsService(new MockAuthenticationDao(user, false));
services.afterPropertiesSet(); services.afterPropertiesSet();
Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY, Cookie cookie = new Cookie(TokenBasedRememberMeServices.ACEGI_SECURITY_HASHED_REMEMBER_ME_COOKIE_KEY,
@ -286,8 +286,8 @@ public class TokenBasedRememberMeServicesTests extends TestCase {
public void testGettersSetters() { public void testGettersSetters() {
TokenBasedRememberMeServices services = new TokenBasedRememberMeServices(); TokenBasedRememberMeServices services = new TokenBasedRememberMeServices();
services.setAuthenticationDao(new MockAuthenticationDao(null, false)); services.setUserDetailsService(new MockAuthenticationDao(null, false));
assertTrue(services.getAuthenticationDao() != null); assertTrue(services.getUserDetailsService() != null);
services.setKey("d"); services.setKey("d");
assertEquals("d", services.getKey()); assertEquals("d", services.getKey());

View File

@ -76,7 +76,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
try { try {
Authentication result = filter.attemptSwitchUser(request); Authentication result = filter.attemptSwitchUser(request);
@ -100,7 +100,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
try { try {
Authentication result = filter.attemptSwitchUser(request); Authentication result = filter.attemptSwitchUser(request);
@ -126,7 +126,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
try { try {
Authentication result = filter.attemptSwitchUser(request); Authentication result = filter.attemptSwitchUser(request);
@ -152,7 +152,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
try { try {
Authentication result = filter.attemptSwitchUser(request); Authentication result = filter.attemptSwitchUser(request);
@ -175,7 +175,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
Authentication result = filter.attemptSwitchUser(request); Authentication result = filter.attemptSwitchUser(request);
assertTrue(result != null); assertTrue(result != null);
@ -199,7 +199,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
public void testBadConfigMissingTargetUrl() { public void testBadConfigMissingTargetUrl() {
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
filter.setSwitchUserUrl("/j_acegi_switch_user"); filter.setSwitchUserUrl("/j_acegi_switch_user");
filter.setExitUserUrl("/j_acegi_exit_user"); filter.setExitUserUrl("/j_acegi_exit_user");
@ -248,7 +248,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
// setup filter // setup filter
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
filter.setExitUserUrl("/j_acegi_exit_user"); filter.setExitUserUrl("/j_acegi_exit_user");
MockFilterChain chain = new MockFilterChain(true); MockFilterChain chain = new MockFilterChain(true);
@ -277,7 +277,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
// setup filter // setup filter
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
filter.setExitUserUrl("/j_acegi_exit_user"); filter.setExitUserUrl("/j_acegi_exit_user");
MockFilterChain chain = new MockFilterChain(true); MockFilterChain chain = new MockFilterChain(true);
@ -308,7 +308,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setSwitchUserUrl("/j_acegi_switch_user"); filter.setSwitchUserUrl("/j_acegi_switch_user");
filter.setTargetUrl("/webapp/someOtherUrl"); filter.setTargetUrl("/webapp/someOtherUrl");
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
filter.doFilter(request, response, chain); filter.doFilter(request, response, chain);
@ -356,7 +356,7 @@ public class SwitchUserProcessingFilterTests extends TestCase {
// setup filter // setup filter
SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter(); SwitchUserProcessingFilter filter = new SwitchUserProcessingFilter();
filter.setMessageSource(new StaticMessageSource()); filter.setMessageSource(new StaticMessageSource());
filter.setAuthenticationDao(new MockAuthenticationDaoUserJackLord()); filter.setUserDetailsService(new MockAuthenticationDaoUserJackLord());
filter.setSwitchUserUrl("/j_acegi_switch_user"); filter.setSwitchUserUrl("/j_acegi_switch_user");
MockFilterChain chain = new MockFilterChain(true); MockFilterChain chain = new MockFilterChain(true);

View File

@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<!-- The authentication manager that iterates through our only authentication provider --> <!-- The authentication manager that iterates through our only authentication provider -->

View File

@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<!-- The authentication manager that iterates through our only authentication provider --> <!-- The authentication manager that iterates through our only authentication provider -->
@ -48,7 +48,7 @@
</bean> </bean>
<bean id="digestProcessingFilter" class="org.acegisecurity.ui.digestauth.DigestProcessingFilter"> <bean id="digestProcessingFilter" class="org.acegisecurity.ui.digestauth.DigestProcessingFilter">
<property name="authenticationDao"><ref local="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref local="inMemoryDaoImpl"/></property>
<property name="authenticationEntryPoint"><ref local="digestProcessingFilterEntryPoint"/></property> <property name="authenticationEntryPoint"><ref local="digestProcessingFilterEntryPoint"/></property>
</bean> </bean>

View File

@ -22,7 +22,7 @@
<beans> <beans>
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -35,7 +35,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
</bean> </bean>
<!-- The authentication manager that iterates through our only authentication provider --> <!-- The authentication manager that iterates through our only authentication provider -->

View File

@ -1335,7 +1335,7 @@ public aspect DomainObjectInstanceSecurityAspect implements InitializingBean {
creation time:</para> creation time:</para>
<para><programlisting>&lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt; <para><programlisting>&lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt;
&lt;property name="saltSource"&gt;&lt;ref bean="saltSource"/&gt;&lt;/property&gt; &lt;property name="saltSource"&gt;&lt;ref bean="saltSource"/&gt;&lt;/property&gt;
&lt;property name="passwordEncoder"&gt;&lt;ref bean="passwordEncoder"/&gt;&lt;/property&gt; &lt;property name="passwordEncoder"&gt;&lt;ref bean="passwordEncoder"/&gt;&lt;/property&gt;
&lt;/bean&gt;</programlisting></para> &lt;/bean&gt;</programlisting></para>
@ -1370,7 +1370,7 @@ public aspect DomainObjectInstanceSecurityAspect implements InitializingBean {
follows:</para> follows:</para>
<para><programlisting>&lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt; <para><programlisting>&lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref bean="authenticationDao"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref bean="userDetailsService"/&gt;&lt;/property&gt;
&lt;property name="userCache"&gt;&lt;ref bean="userCache"/&gt;&lt;/property&gt; &lt;property name="userCache"&gt;&lt;ref bean="userCache"/&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
@ -1465,7 +1465,7 @@ public aspect DomainObjectInstanceSecurityAspect implements InitializingBean {
authentication repository in the application context itself using the authentication repository in the application context itself using the
<literal>InMemoryDaoImpl</literal>:</para> <literal>InMemoryDaoImpl</literal>:</para>
<para><programlisting>&lt;bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"&gt; <para><programlisting>&lt;bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl"&gt;
&lt;property name="userMap"&gt; &lt;property name="userMap"&gt;
&lt;value&gt; &lt;value&gt;
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -1514,7 +1514,7 @@ public aspect DomainObjectInstanceSecurityAspect implements InitializingBean {
&lt;property name="password"&gt;&lt;value&gt;&lt;/value&gt;&lt;/property&gt; &lt;property name="password"&gt;&lt;value&gt;&lt;/value&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="jdbcDaoImpl" class="org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl"&gt; &lt;bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl"&gt;
&lt;property name="dataSource"&gt;&lt;ref bean="dataSource"/&gt;&lt;/property&gt; &lt;property name="dataSource"&gt;&lt;ref bean="dataSource"/&gt;&lt;/property&gt;
&lt;/bean&gt;</programlisting></para> &lt;/bean&gt;</programlisting></para>
@ -2722,7 +2722,7 @@ key: A private key to prevent modification of the nonce token
collaborators:</para> collaborators:</para>
<para><programlisting>&lt;bean id="digestProcessingFilter" class="org.acegisecurity.ui.digestauth.DigestProcessingFilter"&gt; <para><programlisting>&lt;bean id="digestProcessingFilter" class="org.acegisecurity.ui.digestauth.DigestProcessingFilter"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref local="jdbcDaoImpl"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref local="jdbcDaoImpl"/&gt;&lt;/property&gt;
&lt;property name="authenticationEntryPoint"&gt;&lt;ref local="digestProcessingFilterEntryPoint"/&gt;&lt;/property&gt; &lt;property name="authenticationEntryPoint"&gt;&lt;ref local="digestProcessingFilterEntryPoint"/&gt;&lt;/property&gt;
&lt;property name="userCache"&gt;&lt;ref local="userCache"/&gt;&lt;/property&gt; &lt;property name="userCache"&gt;&lt;ref local="userCache"/&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
@ -2907,8 +2907,8 @@ public void loginSuccess(HttpServletRequest request, HttpServletResponse respons
<para><programlisting>base64(username + ":" + expirationTime + ":" + md5Hex(username + ":" + expirationTime + ":" password + ":" + key)) <para><programlisting>base64(username + ":" + expirationTime + ":" + md5Hex(username + ":" + expirationTime + ":" password + ":" + key))
username: As identifiable to TokenBasedRememberMeServices.getAuthenticationDao() username: As identifiable to TokenBasedRememberMeServices.getUserDetailsService()
password: That matches the relevant UserDetails retrieved from TokenBasedRememberMeServices.getAuthenticationDao() password: That matches the relevant UserDetails retrieved from TokenBasedRememberMeServices.getUserDetailsService()
expirationTime: The date and time when the remember-me token expires, expressed in milliseconds expirationTime: The date and time when the remember-me token expires, expressed in milliseconds
key: A private key to prevent modification of the remember-me token key: A private key to prevent modification of the remember-me token
</programlisting></para> </programlisting></para>
@ -2946,7 +2946,7 @@ key: A private key to prevent modification of the remember-me token
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices"&gt; &lt;bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref local="jdbcDaoImpl"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref local="jdbcDaoImpl"/&gt;&lt;/property&gt;
&lt;property name="key"&gt;&lt;value&gt;springRocks&lt;/value&gt;&lt;/property&gt; &lt;property name="key"&gt;&lt;value&gt;springRocks&lt;/value&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
@ -3706,7 +3706,7 @@ $CATALINA_HOME/bin/startup.sh</programlisting></para>
<literal>/web/WEB-INF</literal> directory. A sample <literal>/web/WEB-INF</literal> directory. A sample
<literal>applicationContext.xml</literal> is included below:</para> <literal>applicationContext.xml</literal> is included below:</para>
<programlisting>&lt;bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"&gt; <programlisting>&lt;bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl"&gt;
&lt;property name="userMap"&gt; &lt;property name="userMap"&gt;
&lt;value&gt; &lt;value&gt;
marissa=koala,ROLES_IGNORED_BY_CAS marissa=koala,ROLES_IGNORED_BY_CAS
@ -3718,7 +3718,7 @@ $CATALINA_HOME/bin/startup.sh</programlisting></para>
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt; &lt;bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"&gt; &lt;bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager"&gt;
@ -3895,7 +3895,7 @@ $CATALINA_HOME/bin/startup.sh</programlisting></para>
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="casAuthoritiesPopulator" class="org.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator"&gt; &lt;bean id="casAuthoritiesPopulator" class="org.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator"&gt;
&lt;property name="authenticationDao"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt; &lt;property name="userDetailsService"&gt;&lt;ref bean="inMemoryDaoImpl"/&gt;&lt;/property&gt;
&lt;/bean&gt; &lt;/bean&gt;
&lt;bean id="casProxyDecider" class="org.acegisecurity.providers.cas.proxy.RejectProxyTickets"/&gt;</programlisting></para> &lt;bean id="casProxyDecider" class="org.acegisecurity.providers.cas.proxy.RejectProxyTickets"/&gt;</programlisting></para>

View File

@ -53,7 +53,7 @@ public class WebXmlConverterTests extends TestCase {
(DaoAuthenticationProvider) bf.getBean("daoAuthenticationProvider"); (DaoAuthenticationProvider) bf.getBean("daoAuthenticationProvider");
assertNotNull(dap); assertNotNull(dap);
InMemoryDaoImpl dao = (InMemoryDaoImpl) dap.getAuthenticationDao(); InMemoryDaoImpl dao = (InMemoryDaoImpl) dap.getUserDetailsService();
UserDetails user = dao.loadUserByUsername("superuser"); UserDetails user = dao.loadUserByUsername("superuser");
assertEquals("password",user.getPassword()); assertEquals("password",user.getPassword());
assertEquals(2, user.getAuthorities().length); assertEquals(2, user.getAuthorities().length);

View File

@ -45,7 +45,7 @@
<bean id="passwordEncoder" class="net.sf.acegisecurity.providers.encoding.Md5PasswordEncoder"/> <bean id="passwordEncoder" class="net.sf.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
<bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="net.sf.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
<property name="userCache"><ref local="userCache"/></property> <property name="userCache"><ref local="userCache"/></property>
<property name="passwordEncoder"><ref local="passwordEncoder"/></property> <property name="passwordEncoder"><ref local="passwordEncoder"/></property>
</bean> </bean>
@ -94,7 +94,7 @@
</bean> </bean>
<bean id="rememberMeServices" class="net.sf.acegisecurity.ui.rememberme.TokenBasedRememberMeServices"> <bean id="rememberMeServices" class="net.sf.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
<property name="key"><value>springRocks</value></property> <property name="key"><value>springRocks</value></property>
</bean> </bean>

View File

@ -19,7 +19,7 @@
<!-- ================= CONTAINER ADAPTER CONFIGURATION ================ --> <!-- ================= CONTAINER ADAPTER CONFIGURATION ================ -->
<!-- Data access object which stores authentication information --> <!-- Data access object which stores authentication information -->
<bean id="inMemoryDaoImpl" class="org.acegisecurity.providers.dao.memory.InMemoryDaoImpl"> <bean id="inMemoryDaoImpl" class="org.acegisecurity.userdetails.memory.InMemoryDaoImpl">
<property name="userMap"> <property name="userMap">
<value> <value>
marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR marissa=koala,ROLE_TELLER,ROLE_SUPERVISOR
@ -32,7 +32,7 @@
<!-- Authentication provider that queries our data access object --> <!-- Authentication provider that queries our data access object -->
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref bean="inMemoryDaoImpl"/></property> <property name="userDetailsService"><ref bean="inMemoryDaoImpl"/></property>
<property name="forcePrincipalAsString"><value>true</value></property> <property name="forcePrincipalAsString"><value>true</value></property>
</bean> </bean>

View File

@ -34,7 +34,7 @@
</property> </property>
</bean> </bean>
<bean id="jdbcDaoImpl" class="org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl"> <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property> <property name="dataSource"><ref bean="dataSource"/></property>
</bean> </bean>
@ -81,7 +81,7 @@
</bean> </bean>
<bean id="casAuthoritiesPopulator" class="org.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator"> <bean id="casAuthoritiesPopulator" class="org.acegisecurity.providers.cas.populator.DaoCasAuthoritiesPopulator">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
</bean> </bean>
<bean id="casProxyDecider" class="org.acegisecurity.providers.cas.proxy.RejectProxyTickets"> <bean id="casProxyDecider" class="org.acegisecurity.providers.cas.proxy.RejectProxyTickets">

View File

@ -38,14 +38,14 @@
</property> </property>
</bean> </bean>
<bean id="jdbcDaoImpl" class="org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl"> <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property> <property name="dataSource"><ref bean="dataSource"/></property>
</bean> </bean>
<bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/> <bean id="passwordEncoder" class="org.acegisecurity.providers.encoding.Md5PasswordEncoder"/>
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider"> <bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
<property name="userCache"><ref local="userCache"/></property> <property name="userCache"><ref local="userCache"/></property>
<property name="passwordEncoder"><ref local="passwordEncoder"/></property> <property name="passwordEncoder"><ref local="passwordEncoder"/></property>
</bean> </bean>
@ -94,7 +94,7 @@
</bean> </bean>
<bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices"> <bean id="rememberMeServices" class="org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
<property name="key"><value>springRocks</value></property> <property name="key"><value>springRocks</value></property>
</bean> </bean>
@ -186,7 +186,7 @@
based on the role granted the ability to 'switch' to another user --> based on the role granted the ability to 'switch' to another user -->
<!-- In this example 'marissa' has ROLE_SUPERVISOR that can switch to regular ROLE_USER(s) --> <!-- In this example 'marissa' has ROLE_SUPERVISOR that can switch to regular ROLE_USER(s) -->
<bean id="switchUserProcessingFilter" class="org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter"> <bean id="switchUserProcessingFilter" class="org.acegisecurity.ui.switchuser.SwitchUserProcessingFilter">
<property name="authenticationDao" ref="jdbcDaoImpl" /> <property name="userDetailsService" ref="jdbcDaoImpl" />
<property name="switchUserUrl"><value>/j_acegi_switch_user</value></property> <property name="switchUserUrl"><value>/j_acegi_switch_user</value></property>
<property name="exitUserUrl"><value>/j_acegi_exit_user</value></property> <property name="exitUserUrl"><value>/j_acegi_exit_user</value></property>
<property name="targetUrl"><value>/acegi-security-sample-contacts-filter/secure/index.htm</value></property> <property name="targetUrl"><value>/acegi-security-sample-contacts-filter/secure/index.htm</value></property>

View File

@ -34,7 +34,7 @@
</property> </property>
</bean> </bean>
<bean id="jdbcDaoImpl" class="org.acegisecurity.providers.dao.jdbc.JdbcDaoImpl"> <bean id="jdbcDaoImpl" class="org.acegisecurity.userdetails.jdbc.JdbcDaoImpl">
<property name="dataSource"><ref bean="dataSource"/></property> <property name="dataSource"><ref bean="dataSource"/></property>
</bean> </bean>
@ -71,7 +71,7 @@
</bean> </bean>
<bean id="x509AuthoritiesPopulator" class="org.acegisecurity.providers.x509.populator.DaoX509AuthoritiesPopulator"> <bean id="x509AuthoritiesPopulator" class="org.acegisecurity.providers.x509.populator.DaoX509AuthoritiesPopulator">
<property name="authenticationDao"><ref local="jdbcDaoImpl"/></property> <property name="userDetailsService"><ref local="jdbcDaoImpl"/></property>
<!-- <property name="subjectDNRegex"><value>emailAddress=(.*?),</value></property> --> <!-- <property name="subjectDNRegex"><value>emailAddress=(.*?),</value></property> -->
</bean> </bean>