Add obtainUsername method as per http://forum.springframework.org/viewtopic.php?t=4757.
This commit is contained in:
parent
8091b60194
commit
fdf5c63033
|
@ -66,7 +66,7 @@ public class AuthenticationProcessingFilter extends AbstractProcessingFilter {
|
||||||
|
|
||||||
public Authentication attemptAuthentication(HttpServletRequest request)
|
public Authentication attemptAuthentication(HttpServletRequest request)
|
||||||
throws AuthenticationException {
|
throws AuthenticationException {
|
||||||
String username = request.getParameter(ACEGI_SECURITY_FORM_USERNAME_KEY);
|
String username = obtainUsername(request);
|
||||||
String password = obtainPassword(request);
|
String password = obtainPassword(request);
|
||||||
|
|
||||||
if (username == null) {
|
if (username == null) {
|
||||||
|
@ -127,4 +127,18 @@ public class AuthenticationProcessingFilter extends AbstractProcessingFilter {
|
||||||
protected String obtainPassword(HttpServletRequest request) {
|
protected String obtainPassword(HttpServletRequest request) {
|
||||||
return request.getParameter(ACEGI_SECURITY_FORM_PASSWORD_KEY);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
<action dev="benalex" type="update">Update commons-codec dependency to 1.3</action>
|
<action dev="benalex" type="update">Update commons-codec dependency to 1.3</action>
|
||||||
<action dev="raykrueger" type="update">AbstractProcessingFilter no longer has setters for failures, it uses the exceptionMappings property</action>
|
<action dev="raykrueger" type="update">AbstractProcessingFilter no longer has setters for failures, it uses the exceptionMappings property</action>
|
||||||
<action dev="benalex" type="update">Update to match Spring 1.2 RC 1 official JAR dependencies</action>
|
<action dev="benalex" type="update">Update to match Spring 1.2 RC 1 official JAR dependencies</action>
|
||||||
|
<action dev="raykrueger" type="update">AuthenticationProcessingFilter now provides an obtainUsername method</action>
|
||||||
</release>
|
</release>
|
||||||
<release version="0.8.1" date="2005-03-22">
|
<release version="0.8.1" date="2005-03-22">
|
||||||
<action dev="luke_t" type="add">X509 (certificate-based) authentication support</action>
|
<action dev="luke_t" type="add">X509 (certificate-based) authentication support</action>
|
||||||
|
|
Loading…
Reference in New Issue