Menu
We will be securing REST APIs with role-based OAUTH2 implementation. We will be creating two custom roles as ADMIN and USER and we will use @secured annotation provided by spring security to secure our controller methods based on role. Aug 25, 2017 Spring Security - Configuring HttpSecurity Updated: Aug 25, 2017, Created: Jul 28, 2017 Previous Page Next Page.
![Spring Oauth2authenticationprocessingfilter Antmatchers Spring Oauth2authenticationprocessingfilter Antmatchers](/uploads/1/2/5/3/125390471/743546763.jpg)
![Spring Oauth2authenticationprocessingfilter Antmatchers Spring Oauth2authenticationprocessingfilter Antmatchers](/uploads/1/2/5/3/125390471/929579123.png)
Ok, so here is some advice for Spring beginners:There is a FilterChainProxy class and it is worth knowing how it works. In general, every coming request is filtered by standard filters and additional ones (added in configuration).Every WebSecurityConfigurerAdapter must have proper order and according to this order your requests are bound with proper request matcher.The request matcher provides filters which handle your requests.My problem was that because of improper WebAdapters ordering the handled my request which was not desired behaviour.
The proper request matcher was at further position.Having changed WebAdapters ordering fixed everything.Cheers.