This tutorial will show you how to have two-factor authentication setup in let than five minutes.

Assuming you have Drupal installed and running…


1) Install/Enable the following modules:

2) Install Google Auth Login dependency composer require christian-riesen/otp


3) Create a “Key name” and “Description”

4) Create a KEY

goto: /admin/config/system/keys/add

5) Choose “Key Type”: “Encryption”

6) Choose “Key size”: “256”

7) Enter key value. Generate a 256 bit encryption string and paste it in the text field.

8) Click “Save”


9) Create a PROFILE

goto: /admin/config/system/encryption/profiles/add

10) Create a profile Label

11) For “Encryption Method”, select “Authenticated AES (RealAES)”

12) For “Encryption Key”, select the KEY you created

13) Click “Save”


14) Configure TFA Settings

goto: /admin/config/people/tfa

15) Select “Enable TFA”

16) Select role (“Authenticated user” for everyone)

17) For “Allowed Validation plugins:”, select “GA Login Time-based OTP(TOTP)”

18) For “Default Validation plugin”, select “GA Login Time-based OTP(TOTP)”

19) For “Number of Accepted Codes”, enter “2”

20) For “Encryption Profile”, select the PROFILE you created

21) For “Skip Validation”, enter “1”

22) Click “Save”

DONE! For the remaining variables, select as necessary.