Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ Frontend TOTP activation shortcode #424

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

JurriaanK
Copy link

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.

@jeffpaul jeffpaul added this to the 0.8.0 milestone Dec 23, 2021
@jeffpaul
Copy link
Member

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.

@iandunn
Copy link
Member

iandunn commented Nov 3, 2022

Related #261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants