A simple and basic example to secure REST APIs with authentication using Spring Boot , Security , OAuth2 and JPA.
You can find more about this topic on official spring documentation:
https://projects.spring.io/spring-security-oauth/docs/oauth2.html
This repository supports the following video tutorial: https://www.youtube.com/watch?v=0pD7YeTAUkk, made on the 14/04/2017.