two-factor icon indicating copy to clipboard operation
two-factor copied to clipboard

Feature/ Frontend TOTP activation shortcode

Open JurriaanK opened this issue 3 years ago • 2 comments

This implements a [two-factor-set-totp] shortcode which can be used for front-end TOTP 2fa activation.

I looked into making all provider settings available frontend, but that would require extensive modifications to the whole plugin. So I took a rather straightforward approach. I created specific functions for generating the shortcode output and saving the input because outputting to frontend and saving options from a frontend request demands a different approach than backend, but I tried to reuse as much of the backend functions as possible. I think this brings a much wanted feature in a relatively clean approach.

Notes:

  • Currently only first time activation is possible. Reset of the key has to be done via the user profile. Allowing users to reset via frontend requires a global setting on admin level in my opinion, but two-factor currently doesn't have a global settings page yet.
  • The shortcode doesn't use wp-admin urls, which is handy for sites where wp-admin is blocked for non-admin users.
  • After using the frontend settings the TOTP provider is enabled and set as primary.

JurriaanK avatar Dec 23 '21 15:12 JurriaanK

Per yesterday's bug scrub, general sentiment was in favor of this but going to punt to future release so we can focus on the U2F deprecation in 0.8.0.

jeffpaul avatar Mar 24 '22 18:03 jeffpaul

Related #261

iandunn avatar Nov 03 '22 15:11 iandunn