SEC-576: Add check for null pre-auth principal and return null if found.
This commit is contained in:
+8
-1
@@ -36,7 +36,14 @@ public class PreAuthenticatedAuthenticationProviderTests extends TestCase {
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
public final void testAuthenticateKnownUser() throws Exception {
|
||||
public final void testNullPrincipalReturnsNullAuthentication() throws Exception {
|
||||
PreAuthenticatedAuthenticationProvider provider = new PreAuthenticatedAuthenticationProvider();
|
||||
Authentication request = new PreAuthenticatedAuthenticationToken(null, "dummyPwd");
|
||||
Authentication result = provider.authenticate(request);
|
||||
assertNull(result);
|
||||
}
|
||||
|
||||
public final void testAuthenticateKnownUser() throws Exception {
|
||||
UserDetails ud = new User("dummyUser", "dummyPwd", true, true, true, true, new GrantedAuthority[] {});
|
||||
PreAuthenticatedAuthenticationProvider provider = getProvider(ud);
|
||||
Authentication request = new PreAuthenticatedAuthenticationToken("dummyUser", "dummyPwd");
|
||||
|
||||
Reference in New Issue
Block a user