i have my own AuthenticationSuccessHandler and overriding method onAuthenticationSuccess, where i need to redirect to some page with parameters from request before authenticate (i hope you understand what i mean, sorry for my english)
getRedirectStrategy().sendRedirect(request, response, targetUrl);
How can i do this with POST method (by default it is GET method)
You may do it without
sendRedirectmethod using HTTP1.1 307 Temporary Redirect status code.But AFAIK this is not a common practice and not all web browsers may support this.
Maybe server-side forward will suit your case.
Update:
If you want to send POST-redirect using spring-security API you may implement your own RedirectStrategy.
DefaultRedirectStrategy uses
response.sendRedirectthat will result in302response code sending by servlet container (I’m not sure about every container, at least tomcat sends302).Update 2:
You may send
307back setting response status and “Location” header yourself:User-agent receiving this response must do next request using the same method that was used in previous request. So if first request was
POSTredirected request also will bePOST.