Problem/Motivation

When a user is required to set up TFA, the page displays a message:

You are required to setup two-factor authentication here. You have 2 attempts left. After this you will be unable to login.

This message is displayed regardless of the user's access to the TFA overview page. As a result, users may be served an 'Access denied' page when clicking 'here'.

Proposed resolution

Display a different message for users without the 'setup own tfa' permission.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

Users that have no access to setup their TFA are not directed to the account TFA overview page.

API changes

None.

Data model changes

None.

Comments

idebr created an issue. See original summary.

vatsalkhanna’s picture

vatsalkhanna’s picture

Status: Active » Needs review
jcnventura’s picture

Version: 8.x-1.x-dev » 2.x-dev

Moving all open issues to the 2.x branch.

cmlara’s picture

Status: Needs review » Needs work

Needs rebase to 2.x

Also the message "You do not have permission to setup TFA. Please contact administrator" would likely be better along the lines of:

"You are required to setup two-factor authentication however your account does not have the necessary permissions. Please contact an administrator. You have @remaining attempt(s) left. After this you will be unable to login." Run through formatPlural() so that users know the risk of not taking action.

cmlara’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB
new2.42 KB
cmlara’s picture

Critical change: the hasSkipped() needs to be outside the if/else check as it applies to both those user with and without permission to setup their TFA tokens.

cmlara’s picture

Here is the 1.x patch

The change to TfaPasswordResetTest.php is due to #3387681: TfaPasswordResetTest does not directly test TFA prompts. testing for the messages instead of validating the login forms.

  • cmlara committed a8ff1870 on 2.x
    Issue #3089931 by vatsalkhanna, cmlara: Users are directed to TFA...

  • cmlara committed a5edf54d on 8.x-1.x
    Issue #3089931 by vatsalkhanna, cmlara: Users are directed to TFA...
cmlara’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.