Replacing deprecated @EnableResourceServer with Spring Security

We recently replaced the deprecated @EnableResourceServer with Spring Security and in this post I will share what we did and the new code.