The goal of this project is to create a Spring Boot
application called movies-app
that allows users to log in using Username/Password Authentication
and One-Time Token Login
.
On ivangfr.github.io, I have compiled my Proof-of-Concepts (PoCs) and articles. You can easily search for the technology you are interested in by using the filter. Who knows, perhaps I have already implemented a PoC or written an article about what you are looking for.
-
A
Spring Boot
Java web application that provides a user interface for accessing movie information.During startup, an admin for the Movies App is created with the username
admin
and the passwordadmin
.Users must register by providing a username, password, and email.
Once registered, both admin and users can log in either with their username and password or by requesting a one-time token sent to their email.
-
We are using
MailPit
. It's a lightweight email testing tool that captures and displays emails from your application in a web interface. It helps developers test email functionality without sending real emails.
- In a terminal, navigate to
spring-boot-user-pass-auth-one-time-token-login
root folder; - Run the following command to start Docker Compose containers:
docker compose up -d
- In a terminal, make sure you are in
spring-boot-user-pass-auth-one-time-token-login
folder; - Run the following
Maven
command to start the application:./mvnw clean spring-boot:run --projects movies-app
Application | URL |
---|---|
movies-app |
http://localhost:8080 |
MailPit |
http://localhost:8025 |
-
Note: If the admin or user logs out and tries to log in again using the same token, it will not work!
- Postgres
docker exec -it postgres psql -U postgres -d userdb \dt select * from users;
- To stop
movies-app
, go to the terminal where it's running and pressCtrl+C
; - To stop and remove Docker Compose containers, network and volumes, go to a terminal and, inside
spring-boot-user-pass-auth-one-time-token-login
root folder, run the command below:docker compose down -v