This demo is based from rest-oauth2-sample More reading: Spring Security Reference OAuth for Spring Security and its Tutorial