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 https://start.spring.io/ 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>org.springframework.security.oauth</groupId>  <artifactId>spring-security-oauth2</artifactId>  <version>2.2.0.RELEASE</version>

Get OAuth 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.