I am using JWT token for my project which uses java 11 and speing boot. When I am using JWT Token and when i try to login it is throwing 401 unauthorized error. Not hitting my API call. I am using following line in my code configuration file
.antMatchers(HttpMethod.GET,"url").hasAuthority("devices:read")
.antMatchers(HttpMethod.POST, "url").hasAuthority("devices:create")
.antMatchers(HttpMethod.POST, "url").hasAuthority("devices:write")
.antMatchers(HttpMethod.PUT, "url").hasAuthority("devices:write")
.antMatchers("/h2-console/**").permitAll()
.anyRequest().authenticated();