W WebSecurityConfig
mam .antMatchers("/api/admin").hasRole("ADMIN")
i do tego filtr
` @Override
public void doFilter(ServletRequest request,
ServletResponse response,
FilterChain filterChain)
throws IOException, ServletException {
LogManager.getLogger(JWTAuthenticationFilter.class).info("Checking...");
Authentication authentication = TokenAuthenticationService
.getAuthentication((HttpServletRequest) request, this.userService);
LogManager.getLogger(JWTAuthenticationFilter.class).info(authentication.isAuthenticated());
LogManager.getLogger(JWTAuthenticationFilter.class).info(authentication.getAuthorities());
SecurityContextHolder.getContext()
.setAuthentication(authentication);
filterChain.doFilter(request, response);
}`
isAuthenticated()
zwraca true
, getAuthorities()
zwraca [ADMIN]
więc wydaje mi się, że powinno działać mimo tego wywala 403 Access Denied. Jak to naprawić?