SEC-2919: DefaultLoginPageGeneratingFilter disabled when login-page specified
This commit is contained in:
@@ -6,6 +6,7 @@ import org.springframework.security.web.access.ExceptionTranslationFilter
|
||||
import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler;
|
||||
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter
|
||||
import org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter;
|
||||
import org.springframework.test.util.ReflectionTestUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
@@ -104,4 +105,15 @@ class FormLoginConfigTests extends AbstractHttpConfigTests {
|
||||
apf.usernameParameter == 'xname';
|
||||
apf.passwordParameter == 'xpass'
|
||||
}
|
||||
|
||||
def 'SEC-2919: DefaultLoginGeneratingFilter should not be present if login-page="/login"'() {
|
||||
when:
|
||||
xml.http() {
|
||||
'form-login'('login-page':'/login')
|
||||
}
|
||||
createAppContext()
|
||||
|
||||
then:
|
||||
getFilter(DefaultLoginPageGeneratingFilter) == null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,4 +151,16 @@ class OpenIDConfigTests extends AbstractHttpConfigTests {
|
||||
attributes[1].required
|
||||
attributes[1].getCount() == 2
|
||||
}
|
||||
|
||||
def 'SEC-2919: DefaultLoginGeneratingFilter should not be present if login-page="/login"'() {
|
||||
when:
|
||||
xml.http() {
|
||||
'openid-login'('login-page':'/login')
|
||||
}
|
||||
createAppContext()
|
||||
|
||||
then:
|
||||
getFilter(DefaultLoginPageGeneratingFilter) == null
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user