In previous chapters, we illustrated the JSON Web Token (JWT) and used that for a resource API authentication. If you remember, we wrote all of the code for this in a single module (though we used a different package) and violated the single responsibility principle (SRP). Needless to say, it was a monolith service. We were then able to familiarize ourselves with the problems encountered with the monolith. Let's split this monolith into small microservices, as follows:
We will create two modules in a Maven project and these modules represent the microservices—one authentication service and one identity service. The authentication service will have the APIs for JWT, and identity service APIs are used to create identities, such as a person or an organization. All the APIs of the identity service require a valid JWT token obtained...