mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-09-08 20:51:41 +00:00
SEC-1790: Disable use of spring-security-redirect by default for SimpleUrlLogoutSuccesshandler.
This commit is contained in:
parent
5238ba0e26
commit
a087e828a6
@ -30,8 +30,8 @@ import org.springframework.util.StringUtils;
|
|||||||
* will be used for the destination.
|
* will be used for the destination.
|
||||||
* </li>
|
* </li>
|
||||||
* <li>
|
* <li>
|
||||||
* If a parameter matching the <tt>targetUrlParameter</tt> has been set on the request, the value will be used as
|
* If a parameter matching the value of <tt>targetUrlParameter</tt> has been set on the request, the value will be used
|
||||||
* the destination.
|
* as the destination. By default this has the value "spring-security-redirect".
|
||||||
* </li>
|
* </li>
|
||||||
* <li>
|
* <li>
|
||||||
* If the <tt>useReferer</tt> property is set, the "Referer" HTTP header value will be used, if present.
|
* If the <tt>useReferer</tt> property is set, the "Referer" HTTP header value will be used, if present.
|
||||||
@ -154,7 +154,9 @@ public abstract class AbstractAuthenticationTargetUrlRequestHandler {
|
|||||||
* to "spring-security-redirect".
|
* to "spring-security-redirect".
|
||||||
*/
|
*/
|
||||||
public void setTargetUrlParameter(String targetUrlParameter) {
|
public void setTargetUrlParameter(String targetUrlParameter) {
|
||||||
Assert.hasText(targetUrlParameter, "targetUrlParameter cannot be null or empty");
|
if (!StringUtils.hasText(targetUrlParameter)) {
|
||||||
|
targetUrlParameter = null;
|
||||||
|
}
|
||||||
this.targetUrlParameter = targetUrlParameter;
|
this.targetUrlParameter = targetUrlParameter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,10 @@ import org.springframework.security.web.authentication.AbstractAuthenticationTar
|
|||||||
public class SimpleUrlLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler
|
public class SimpleUrlLogoutSuccessHandler extends AbstractAuthenticationTargetUrlRequestHandler
|
||||||
implements LogoutSuccessHandler {
|
implements LogoutSuccessHandler {
|
||||||
|
|
||||||
|
public SimpleUrlLogoutSuccessHandler() {
|
||||||
|
super.setTargetUrlParameter(null);
|
||||||
|
}
|
||||||
|
|
||||||
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
|
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
|
||||||
throws IOException, ServletException {
|
throws IOException, ServletException {
|
||||||
super.handle(request, response, authentication);
|
super.handle(request, response, authentication);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user