Questo progetto si concentra sull'implementazione di autenticazione e autorizzazione. I dettagli principali includono l'uso di Spring Boot con Spring Security per la gestione degli utenti e dei ruoli. Gli utenti che si registrano vengono automaticamente assegnati al ruolo USER. Attualmente, la funzionalità per consentire agli ADMIN di creare altri ADMIN non è ancora implementata.
- Backend: Spring Boot, Spring Security, JSON Web Token (JWT), PostgreSQL
- Frontend: Angular, Forms Module, HttpClientModule, Guards
- Autenticazione: Utilizzo di JWT per gestire l'autenticazione, con configurazioni CORS su ogni controller per consentire l'accesso da qualsiasi URL.
- Ruoli Utente: Gli utenti registrati vengono assegnati automaticamente al ruolo USER.
- Database: Utilizzo di un database relazionale PostgreSQL per la memorizzazione dei dati utente.
- Frontend: Framework Angular per il recupero dei dati utente durante il login tramite il token. La registrazione prevede l'hashing delle password.
- Creazione di Admin: Implementare la funzionalità che consente agli ADMIN di creare altri ADMIN.
- Interceptor: Configurato l'interceptor per facilitare l'estensione del progetto per effettuare chiamate HTTP ad altre API che richiedono l'autenticazione.
-
Backend:
- Configurare correttamente il database PostgreSQL.
- Eseguire l'applicazione Spring Boot.
-
Frontend:
- Assicurarsi che Angular sia installato.
- Eseguire l'applicazione Angular.
In caso di tentativo di bypassare l'autorizzazione, gli utenti vengono indirizzati a una pagina di accesso negato. Da questa pagina, è possibile tornare alla pagina di login.
This project focuses on implementing authentication and authorization. Key details include the use of Spring Boot with Spring Security for user and role management. Users who register are automatically assigned the USER role. Currently, the functionality to allow ADMINs to create other ADMINs is not yet implemented.
- Backend: Spring Boot, Spring Security, JSON Web Token (JWT), PostgreSQL
- Frontend: Angular, Forms Module, HttpClientModule, Guards
- Authentication: Use of JWT to handle authentication, with CORS configurations on every controller to allow access from any URL.
- User Roles: Registered users are automatically assigned the USER role.
- Database: Use of PostgreSQL relational database for storing user data.
- Frontend: Angular framework for retrieving user data during login through the token. Registration involves password hashing.
- Admin Creation: Implement functionality to allow ADMINs to create other ADMINs.
- Interceptor: Configured interceptor for easy project extension to make HTTP calls to other APIs requiring authentication.
-
Backend:
- Properly configure the PostgreSQL database.
- Run the Spring Boot application.
-
Frontend:
- Ensure Angular is installed.
- Run the Angular application.
In case of an attempt to bypass authorization, users are redirected to an access denied page. From this page, one can return to the login page.