Spring Boot Two-Factor Authentication

JWT and Authenticator App

Amr Saleh
Javarevisited

--

Photo by Pixabay from Pexels

A few days ago I wrote a story about JWT and social authentication using Spring Boot, check it out if you haven’t yet.

This story is an extension to the above story, which, we will add two-factor authentication.

Two-factor authentication is a way to increase the security of your product by adding an extra layer of security by asking the user to provide a second form of identification alongside username and password.

In this story we will use TOTP (Time-based One Time Password) as the second form of identification. This TOTP is generated by an app on user mobile device, like Google authenticator or Microsoft authenticator.

The below video shows what we are about to achieve.

--

--

Amr Saleh
Javarevisited

I’m a software engineer who is passionate about software architecture and design. Enjoy coding in Java, Scala, and JavaScript.