User management service with Spring security, JWT, REST and Angular
Small user management application that allows you to read, create, delete or update (CRUD) the user information in a simple, but friendly user interface created with Angular material. The app contains secure authentication and authorization features using JWT and Spring roles; therefore, some features are available just for the admin and not for a common user.
Small, but comprehensive, this application is the perfect starting point for a project using Spring boot with REST and Spring Security in the backend and Angular for the frontend.
After the login, a JWT token is created and saved in the local storage. Then, for each request to the backend the token is attached in the header using an http interceptor and therefore the requests are allowed to reach our server. An angular guard prevents unwanted users to reach the main page of the app.
In the controller, @RolesAllowed annotation is used for delimiting the authorization level for different users.
In order to see the login credentials, just check the data.sql file where the in-memory database is loaded with users at startup, nothing simpler than that.
N.B.: The application is ready and can be delivered immediately and it contains two different projects, the backend and the frontend. The backend can be started with mvn spring-boot:run from an IDE terminal or by running the jar with java -jar name-of-the-jar.jar. The frontend can be started by writing ng serve in the terminal from within the frontend project (auth_frontend).