Two-factor authentication in AdonisJS

Two-factor authentication in AdonisJS

48mins
8 lessons
Intermediate
Start course

Two-factor authentication is a way of adding additional layer of security to an application. So in addition to providing the standard email and password combination when logging in, users will be required to provide an additional authentication code before they are actually logged in. In this course, we cover how to implement two-factor authentication in AdonisJS using authenticator apps like Google Authenticator and Authy.

What you'll learn

  • How to enable and disable two-factor authentication for users
  • Logging in with authentication code
  • Logging in with recovery codes
  • Generating recovery codes

Two-factor authentication

1m 53s

In this lesson, we introduce the course and what we'll be covering in the course.

In this lesson, we kick off the course by adding the necessary columns for two-factor authentication to the users table while covering what each of them does along the line.

In this lesson, we'll cover how users can enable two-factor authentication. This include generating a secret code as well as a QR code that users needs to scan with their authenticator apps.

This lesson covers how to log in with an authentication code for users who have enabled two-factor authentication.

In this lesson, we are going to cover generating the two-factor recovery codes and we’ll be doing that at the point of enabling two-factor authentication.

In this lesson, we cover how to log in with recovery codes in addition to being able to log in with codes from authenticator apps.

In this lesson, we add a way for users to regenerate their recovery codes which will come in handy if they lost their recovery codes.

To wrap up this course, let's add a way for users to disable two-factor authentication on their accounts.

Chimezie Enyinnaya

Hi, I'm Chimezie Enyinnaya, your teacher.

I’m a self-taught software developer based in Lagos, Nigeria, with over 8 years of experience. In the last couple of years, I've been doing more teaching because I enjoy sharing my knowledge so that others can benefit from it. Come along as I teach you all I know about AdonisJS, Node.js, and JavaScript at large!