javaspring-boottokenapi-security

How can I protect my Java Spring Boot API with my own Custom Token System?


I am trying to protect my Java Spring API with a Token System. The aim is that I can say, if the token has privileges an which (Token xyz is Admin or just a User) In the Controller I'd like to say that only Admins are allowed to call the method.

I hope you understand my problem. Thanks!


Solution

  • You can implement Roles and Privileges with spring security. I hope this tutorial will help you regarding the same. https://www.baeldung.com/role-and-privilege-for-spring-security-registration