Problem/Motivation
In TFA 8.x-1.13, login plugins are included in the full TFA setup sequence even when they have no corresponding setup plugin.
This affects custom TfaLogin plugins that perform login-policy checks but do not require user-specific setup.
When a user completes TOTP enrollment, the setup form attempts to proceed to the additional login plugin. If its setup plugin does not exist, the user may encounter a 404 instead of returning to the TFA overview.
Reproduced this with a custom login plugin (without setup plugin) on Drupal 11 and TFA 1.13.0. It extends TfaBasePlugin and implements TfaLoginInterface. The plugin implements loginAllowed() and ready(). It requires no user-specific setup.
The login plugin itself works correctly: it allows or denies the TFA login exception according to the user's policy configuration.
Steps to reproduce
- Configure TOTP as the default validation plugin.
- Create a custom TfaLogin plugin that implements loginAllowed() and ready(), without providing a corresponding TfaSetup plugin.
- Enable the custom plugin under TFA login plugins.
- Require TFA for an authenticated test user and allow initial enrollment.
- Log in with an account that has not configured TFA.
- Start TOTP setup and verify the authenticator code.
- TFA reports success, an additional setup step and may return a 404.
Proposed resolution
In TfaSetupForm::tfaFullSetupSteps(), include an enabled login plugin only when its registered setupPluginId refers to an existing setup plugin. It would preserve login plugins that require user-specific setup, while excluding login-only plugins.
The 1.x plugin-manager fallback that automatically creates a setup plugin ID has already been deprecated for removal in 2.x. This issue exposes another problem of assuming that all login plugins require a corresponding setup plugin.
Remaining tasks
Provide a patch and test it.
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | Full_setup_includes_login_plugins_without_setup_plugin-3638608-2.patch | 856 bytes | jordik |
Comments
Comment #2
jordik commentedComment #3
jordik commented