Configuring the Client Credentials grant type
This recipe shows you how to configure the Client Credentials grant type, which is appropriate when an application needs to access resources for its own benefit instead of accessing the Resource Owner's resources.
Getting ready
To run this recipe, you can use your preferred IDE and must have Java 8 and Maven installed. For this recipe, we will be executing some HTTP requests through the usage of CURL commands as we did before. Make sure you have CURL or Postman tools installed before continuing. This recipe will use Spring Security OAuth2 Framework and we will not add any database support. The source code for this recipe can be downloaded from https://github.com/PacktPublishing/OAuth-2.0-Cookbook/tree/master/Chapter02/client-credentials-server.
How to do it...
The following steps will guide you to configure an Authorization Server and a Resource Server using Spring Security OAuth2:
- Create the initial project using Spring Initializr, as we did for...