У меня проблема с плагином ядра безопасности Spring
У меня есть таблица Excel, и в одной ячейке есть ссылка на ресурс моего веб-приложения (например, http://localhost:8080/myapp/item/1)
Если я нажму на ссылку, откроется браузер (там, где я уже вошел) и вместо перехода по URL, который я нажал, он отправит меня домой (целевой URL по умолчанию) ...
Я изменил bean authenticationProcessingFilter, и я регистрирую, что происходит в doFilter, и вот что я получаю
http://localhost:8080/myapp/item/1
E5E79669EBC938953AC6DCA4F1D38D56 <- this is the session id
false <- just printing if I'm logged in
http://localhost:8080/myapp/login/auth
1446A2704FC61E6304F0AC95F8BDAF22 <- this is the session id, and now is different
true <- just printing if I'm logged in
http://localhost:8080/myapp/home
1446A2704FC61E6304F0AC95F8BDAF22 <- this is the session id
true <- just printing if I'm logged in
Я не знаю, почему это меняет идентификатор сеанса, этовсе происходит в переопределить doFilter UsernamePasswordAuthenticationFilter
public class MyAuthFilter extends RequestHolderAuthenticationFilter {
@Override
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException {
HttpServletRequest r2 = (HttpServletRequest)request;
println r2.getSession().getId();
super.doFilter(request, response, chain);
}
}
Как мне перенаправить на URL, который я нажал?