Sample code used for the blog post: http://sivatechlab.com/secure-rest-api-using-spring-security-oauth2/