1
0
mirror of synced 2026-08-05 01:36:56 +00:00
This commit is contained in:
Ben Alex
2005-04-13 22:17:05 +00:00
parent 8091b60194
commit fdf5c63033
2 changed files with 16 additions and 1 deletions
@@ -66,7 +66,7 @@ public class AuthenticationProcessingFilter extends AbstractProcessingFilter {
public Authentication attemptAuthentication(HttpServletRequest request)
throws AuthenticationException {
String username = request.getParameter(ACEGI_SECURITY_FORM_USERNAME_KEY);
String username = obtainUsername(request);
String password = obtainPassword(request);
if (username == null) {
@@ -127,4 +127,18 @@ public class AuthenticationProcessingFilter extends AbstractProcessingFilter {
protected String obtainPassword(HttpServletRequest request) {
return request.getParameter(ACEGI_SECURITY_FORM_PASSWORD_KEY);
}
/**
* Enables subclasses to override the composition of the username, such as
* by including additional values and a separator.
*
* @param request so that request attributes can be retrieved
*
* @return the username that will be presented in the
* <code>Authentication</code> request token to the
* <code>AuthenticationManager</code>
*/
protected String obtainUsername(HttpServletRequest request) {
return request.getParameter(ACEGI_SECURITY_FORM_USERNAME_KEY);
}
}