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

  1. Configure TOTP as the default validation plugin.
  2. Create a custom TfaLogin plugin that implements loginAllowed() and ready(), without providing a corresponding TfaSetup plugin.
  3. Enable the custom plugin under TFA login plugins.
  4. Require TFA for an authenticated test user and allow initial enrollment.
  5. Log in with an account that has not configured TFA.
  6. Start TOTP setup and verify the authenticator code.
  7. 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

Comments

jordik created an issue. See original summary.

jordik’s picture

jordik’s picture

Status: Active » Needs review