В весенней версии безопасности 3.0.6 исправлен эксплойт выхода из системы CRLF (https://jira.springsource.org/browse/SEC-1790) они отключили использование параметра spring-security-redirect.
Поддержка по умолчанию для параметра перенаправления в URL-адресах выхода также была удалена в версии 3.0.6. В 3.1 его уже нужно включать явно.
Есть ли способ снова включить параметр перенаправления, чтобы я мог динамически перенаправлять в своем контроллере выхода из системы Grails Spring Security?
LogoutContoller.groovy
def user = springSecurityService.currentUser
if (params.redirect) {
// this needs to log the user out and then redirect, so don't redirect until we log the user out here
log.info "Redirecting " + springSecurityService.currentUser.username + " to " + params.redirect
// the successHandler.targetUrlParameter is spring-security-redirect, which should redirect after successfully logging the user out
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl + "?spring-security-redirect="+params.redirect
return;
}
redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl // '/j_spring_security_logout'
Следующее больше не работает для версий Spring Security 3.0.6+