Giter Club home page Giter Club logo

craft-twofactorauthentication's Introduction

Two-Factor Authentication

Two-Factor Authentication

Craft 3 plugin for two-factor or two-step login using Time Based OTP (TOTP, like Google Authenticator). Every user can setup TOTP themselves, the plugin does not force users. Admins can list usage in user tables.

Inner working

Login works as usual for users without 2-factor auth.

When enabled, the user is redirected to the 2-factor verification page after login. This means the user is already logged in. When the user tries to visit an other Control Panel page than the public ones before verification, the logout is triggered. This blocks the user from visiting the CP unverified.

Requirements

  • Craft 3.0.0
  • PHP 7.x at least
  • userSessionDuration in the general.php config should be larger than 0 (by default)

Setting up front end 2FA

When using a login for front end users, the following steps add 2FA support.

  • Copy the two-factor-authentication.php file to your config/ folder.
  • Set verifyFrontEnd to true in the config file.
  • Define what urls should be protected with 2FA verification. Choose between using the frontEndPathWhitelist or frontEndPathBlacklist! Using both will block everything! See config for additional info.
  • Build a 2FA login-verify form accessible by url like the example twig.
  • Set the verifyPath. For our login-verify.twig example the path would be login-verify.
  • Allow users setting up 2FA in front end by building a template like the example twig.
  • Set the settingsPath. For our two-factor-settings.twig example the path would be two-factor-settings.

Setting up config

Copy the two-factor-authentication.php file to your config/ folder.

Resetting a user's 2FA

Simply remove the user's twofactorauthentication_user record. This disables 2FA for that user.

Screens

Setting screen when turning 2FA on

Setting screen when turning 2FA on

Setting screen when turning 2FA off

Setting screen when turning 2FA off

Login verification screen

Login verification screen

License

Copyright © 2019 Born05

See license

craft-twofactorauthentication's People

Contributors

roelvanhintum avatar romainpoirier avatar brandonkelly avatar coxeh avatar mikestecker avatar roberskine avatar samuelbirch avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.