Needs work
Project:
Two-factor Authentication (TFA)
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2022 at 05:06 UTC
Updated:
10 Jan 2023 at 08:55 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
gregglesI think this makes sense as a feature concept. I believe its' not currently possible, so marking this as a feature.
The idea you're requesting is hinted at in #2931150: Confirmation forms should not require passwords so you might want to check that out.
Comment #3
bandana commentedI hope I'm on the right track here..
This is based on an event listener that replaces the current request controller with its own through
the setController() method to redirect and start the tfa process based on the core tfa module
I placed it in a sub-module since it runs on each page request
which you might not want if you are mainly interested in login functionality.
It is limited to authenticated users
It is pluggable to allow for custom route evaluation
It dispatches events before and after plugin evaluation to allow for preemptive and override actions
Minimum valid time between tfa processes is hardcoded to 15 seconds to allow for bad connection/slow page loads
I had to make a few edits in the following core files to make this feature work:
tfa.routing.yml
TfaLoginController.php
EntryForm.php
Comment #5
bandana commentedAdded no_cache option to all tfa enabled routes
Comment #6
bandana commentedCode cleanup and fixing failed tests
Comment #7
bandana commentedComment #8
bandana commentedFixed some bugs and added redirect command for ajax requests.
Comment #9
bandana commentedDispatched events fix.
Comment #10
jcnventuraI really like this, but not as an optional module. The module should have a major refactor to be event subscriber-based to avoid having to mess so much with Drupal's internals.
Comment #11
bandana commentedDoes it make sense for that to happen in the current 2.x branch or 3.x?
Comment #12
jcnventura2.x branch is very early alpha, so this would be in the current branch.