How to do it...

The following steps will show you how to implement both the Authorization Server and Resource Server to use the remote token validation approach:

  1. Create two applications using Spring Initializr named remote-authserver and remote-resource, both using the group ID com.packt.example. Both applications must use the dependencies Web, Security, JPA, and MySQL. These dependencies can be added at Spring Initializr.
  2. Import both applications to your preferred IDE and make sure you add the following dependency into pom.xml for both projects:
<dependency>  <groupId>org.springframework.security.oauth</groupId>  <artifactId>spring-security-oauth2</artifactId></dependency>
  1. Create the table which will hold the Resource Owner's information ...

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.