Я написал фильтр, который расширяет AbstractAuthenticationProcessingFilter
.
Ниже описан переопределенный метод:
@Override
public Authentication attemptAuthentication(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse)
throws AuthenticationException, IOException, ServletException {
if (StringUtils.isNoneBlank(cookie)) {
return authenticationProvider.authenticate(token);
//Here I want to return jsession id and establish a session.
} else {
return handleInSomeOtherWay(httpServletRequest);
//Here I DONT want to return jsessionid
}
}
Как мне добиться возврата идентификатора jsession на одном пути, а не на другом?Я пытался установить allowSessionCreation = false
, но это не помогло.