How to do it...

Perform the following steps to create an OAuth 2.0 Provider that allows for client registration:

  1. Create the initial project using Spring Initializr as we did for other recipes in this book. Go to and define the following data:
    • Set up the Group as com.packt.example
    • Define the Artifact as oauth2provider
    • Add Web, JPA, MySQL, Security, and Thymeleaf as dependencies for this project
  2. After creating the oauth2provider project, import it to your IDE. If using Eclipse, import it as a Maven project.
  3. Open the pom.xml file and add the following dependencies:
<dependency>  <groupId></groupId>  <artifactId>spring-security-oauth2</artifactId>  <version>2.2.0.RELEASE</version>

Get OAuth 2.0 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.