From 05c7abe19161eeb22509d7cb27900516c0f285c4 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 30 Apr 2010 18:55:55 +0100 Subject: [PATCH] SEC-1445: Tests for setting of username and password parameter names through the form-login element. --- .../config/http/FormLoginConfigTests.groovy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/src/test/groovy/org/springframework/security/config/http/FormLoginConfigTests.groovy b/config/src/test/groovy/org/springframework/security/config/http/FormLoginConfigTests.groovy index 2168173035..2dcca5a47f 100644 --- a/config/src/test/groovy/org/springframework/security/config/http/FormLoginConfigTests.groovy +++ b/config/src/test/groovy/org/springframework/security/config/http/FormLoginConfigTests.groovy @@ -68,4 +68,17 @@ class FormLoginConfigTests extends AbstractHttpConfigTests { FieldUtils.getFieldValue(apf, "successHandler") == appContext.getBean("sh"); FieldUtils.getFieldValue(apf, "failureHandler") == appContext.getBean("fh") } + + def usernameAndPasswordParametersCanBeSetThroughNamespace() { + xml.http { + 'form-login'('username-parameter': 'xname', 'password-parameter':'xpass') + } + createAppContext() + + def apf = getFilter(UsernamePasswordAuthenticationFilter.class); + + expect: + apf.usernameParameter == 'xname'; + apf.passwordParameter == 'xpass' + } }