Skip to content

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

Notifications You must be signed in to change notification settings

ivangfr/spring-boot-user-pass-auth-one-time-token-login

Repository files navigation

spring-boot-user-pass-auth-one-time-token-login

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.

Proof-of-Concepts & Articles

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.

Additional Readings

Applications

  • movies-app

    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 password admin.

    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.

  • MailPit

    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.

Prerequisites

Start Environment

  • 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

Running movies-app using Maven

  • 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 URLs

Application URL
movies-app http://localhost:8080
MailPit http://localhost:8025

Demonstration

  • User Registration

    user-registration

  • Username/Password Login

    username-password-login

  • One-Time Token Login

    one-time-token-login

    Note: If the admin or user logs out and tries to log in again using the same token, it will not work!

Util Commands

  • Postgres
    docker exec -it postgres psql -U postgres -d userdb
    \dt
    select * from users;

Shutdown

  • To stop movies-app, go to the terminal where it's running and press Ctrl+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

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published