Authentication is an everyday necessity in our applications, and tokens are widely used nowadays. In this project offer login to users in two ways; the first was by email and password, and the second way by token; I hope that this project could be helpful for someone that will start with the topic of JWT tokens.
- You have to be installed the applications Docker and Docker-compose .
- The backend was developed in java with the Ide IntelliJ IDEA (optional).
- The frontend was developed in Angular 12 with Visual Studio Code editor(optional).
- Any web browser..
Use the command docker-compose up. then both projects run at the same time; the backend is a java app, and the second one is an Angular app after a few minutes you could test all applications.
Use the Postman collection attached in the project.
-
First, go into the web browser and put this URL http://localhost:4200; you will see the login session.
-
Select the option register, and you have to create an account.
-
Select the close option session, and you again try to log in with your credentials but this time you have to select the option "remember me"; after a successful login, you could close the web browser.
-
Open again the web browser, and you will be gone to the same URL you will be logged in without any password!. After 2 minutes http://localhost:4200, the Token will expire, and if you want to try to reaccess it, you will have to put in your credentials again.
Please check this post about backend app: Token server
Please check this post about frontend app: Login app