Spring Boot

Headstart Framework: Identity Access Management (IAM) Service

The general design of the Headstart Framework makes it flexible to implement an Identity Access Management (IAM) service. Then, we could use the service with both monolith or distributed applications. Also, we could turn a Headstart application into an Identity Access Management (IAM) service for Microservices authentication and authorization. Microservices can authenticate requests via JWT tokens and control access with the same set of authorities (permissions) across services. Note that Headstart does not authorize users on roles because they are merely containers of permissions.

Headstart Framework Checks User Authorization Across Microservices

Authentication and authorization go hand-in-hand to ensure users have the proper access and permissions to resources or services. They are easy to implement in monolith applications, but not across Microservices. With the Headstart Framework, we can check for a user’s permissions using standard Spring Security annotations like @PreAuthorize across Microservices.

For instance, we have Microservice A and B, where A directly uses B. A concrete example could be a Product Catalog service that uses an Inventory service. A user could have all permissions to the Product Catalog service. However, he could have limited access to the Inventory service.

Turn A Headstart Application Into An IAM Service

The Headstart framework allows us to turn an application into an IAM service using only one Headstart Maven dependency. First, we can create a Spring Boot application via Spring Initlzr with Maven dependency on Spring Security, among other dependencies. Then, update the pom.xml  to include Maven dependency whose codes do not access shared security configuration files or databases.

Then, configure the service to point to our Headstart IAM service using the following property.

For example, we can have this configuration.

Assume our Product Catalog service has a controller, as shown below.

We can get all the production information using the following technical details. The Product Catalog service sends the received token to the IAM service for validation. Overall, the whole picture would be what the diagram below portrays.

Headstart Framework IAM

If the JWT token is valid, we get the information on products.

Similarly, the Product Catalog service can send the same token in requests to the Inventory service for data or additional processing.

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like