concept authentication service in category microservice

appears as: n authentication service, authentication service, The authentication service, authentication services, uthentication service
Spring Microservices in Action

This is an excerpt from Manning's book Spring Microservices in Action.

Figure 1.11 shows how you can implement the three patterns described previously to build an authentication service that can protect your microservices.

Like all the examples in this book’s chapters, your OAuth2 authentication service is going to be another Spring Boot service. The authentication service will authenticate the user credentials and issue a token. Every time the user tries to access a service protected by the authentication service, the authentication service will validate that the OAuth2 token was issued by it and that it hasn’t expired. The authentication service will be the equivalent of the authentication service in figure 7.1.

After the Maven dependency is added, you need to first tell your authentication service how it’s going to generate and translate JWT tokens. To do this, you’re going to set up in the authentication service a new configuration class called authentication--service/src/java/com/thoughtmechanix/authentication/security/JWT TokenStoreConfig.java. The following listing shows the code for the class.