SEC-474: Gracefully abort if username and password non-retrievable.

This commit is contained in:
Ben Alex 2007-05-23 06:48:42 +00:00
parent f45c0944ef
commit a18bd9100c
1 changed files with 5 additions and 0 deletions

View File

@ -285,6 +285,11 @@ public class TokenBasedRememberMeServices implements RememberMeServices, Initial
username = successfulAuthentication.getPrincipal().toString();
password = successfulAuthentication.getCredentials().toString();
}
// If unable to find a username and password, just abort as TokenBasedRememberMeServices unable to construct a valid token in this case
if (!StringUtils.hasLength(username) || !StringUtils.hasLength(password)) {
return;
}
Assert.hasLength(username);
Assert.hasLength(password);