SEC-1459: Generifying AuthenticationUserDetailsService. Now parameterized with <? extends Authentication>.

This commit is contained in:
Luke Taylor
2010-04-15 01:47:29 +01:00
parent a45d2a4fb2
commit 74896f217b
10 changed files with 38 additions and 35 deletions

View File

@@ -104,9 +104,10 @@ public class PreAuthenticatedAuthenticationProviderTests {
return result;
}
private AuthenticationUserDetailsService getPreAuthenticatedUserDetailsService(final UserDetails aUserDetails) {
return new AuthenticationUserDetailsService() {
public UserDetails loadUserDetails(Authentication token) throws UsernameNotFoundException {
private AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken>
getPreAuthenticatedUserDetailsService(final UserDetails aUserDetails) {
return new AuthenticationUserDetailsService<PreAuthenticatedAuthenticationToken>() {
public UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token) throws UsernameNotFoundException {
if (aUserDetails != null && aUserDetails.getUsername().equals(token.getName())) {
return aUserDetails;
}

View File

@@ -31,6 +31,7 @@ public class WebSphere2SpringSecurityPropagationInterceptorTests {
}
/** SEC-1078 */
@SuppressWarnings("unchecked")
@Test
public void createdAuthenticationTokenIsAcceptableToPreauthProvider () throws Throwable {
WASUsernameAndGroupsExtractor helper = mock(WASUsernameAndGroupsExtractor.class);