Securing cloud-native applications using MicroProfile JWT
MicroProfile JWT utilizes JSON Web Token (JWT) with some additional claims for role-based access control of an endpoint to help with securing cloud-native applications. Securing cloud-native applications is often the must-have feature. It is often the case that cloud-native applications supply sensitive information, which should only be accessible to a particular group of users. Without securing cloud-native applications, everyone would be able to access the information. Jakarta Security (source code at https://github.com/eclipse-ee4j/security-api), a specification (https://jakarta.ee/specifications/security/) under Jakarta EE, can be used to secure cloud-native applications.
In the following example, the method checkAccount
is secured via the Jakarta Security API @RolesAllowed
. This method can only be invoked by clients with the access group StockViewer
or StockTrader
. All other users are denied as shown here:
@RolesAllowed...