Breaking the OAuth 2.0 Provider in the middle
This recipe will show how you can create an OAuth 2.0 Provider, dividing Authorization Server and Resource Server responsibilities into different projects.
Getting ready
To run this recipe, you will need to create two different applications to implement the Authorization Server and the Resource Server responsibilities. As the Authorization Server is in charge of issuing access tokens and Resource Server has to validate access tokens, both applications need a shared database. In that way, the Resource Server can query for an access token that was persisted in some database structure by the Authorization Server. For this recipe, you will need Redis as the strategy for database sharing.
How to do it...
Perform the following steps to start creating the Authorization Server and Resource Server separately:
- The first thing to do is to create both applications. Go to Spring Initializr and generate the project for the Authorization Server named (
Artifact
)...