Я пытался изменить настройки безопасности как в web.xml, @ServletSecurity в файле сервлета и @inject SecurityContext в классе сервлета
Изменить 1:
Я удалил @ServletSecurity в моем классе сервлетов и написал фильтр, куда я добавляю SecurityContext и проверяю следующим образом:
Код: Выделить всё
public class AuthorizationFilter implements Filter {
@Inject
SecurityContext sc;
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) {
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse res = (HttpServletResponse) response;
if (req.isUserInRole("ROLE_A") || sc.isCallerInRole("ROLE_A")) {
doChain(request, response);
} else {
// log info about Principal and session attributes
}
}
}
code>, все атрибуты сеанса и Principal присутствуют, как и еще 5 ajax-запросов.
Какое-нибудь представление о том, что происходит?
Подробнее здесь: https://stackoverflow.com/questions/790 ... -and-glass