OAuth 2 for Spring Security (spring-security-oauth2) is the module to provide OAuth 2 support to Spring Security. We will add it as a dependency in our pom.xml file:
<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
</dependency>