Skip to content

2fa rencryption does not work #64

@MartinVanVan

Description

@MartinVanVan

Hello,

I've tried the steps to reencrypt all data and create a new crypt key.
Until the last step everything works as expected.
Login into the admin panel with 2fa also works.

But after I do the last step bin/magento gene:encryption-key-manager:invalidate to invalidate the old crypt, I can't log into the admin panel using 2fa. As stated in the final step to test admin and customer login expected that everything will work as usual.

Looking into the system.log i get following error if i try to enter th 2fa code:

[2025-01-06T16:44:34.152131+00:00] main.CRITICAL: Magento\Framework\Exception\NoSuchEntityException: Secret for user with ID#12 was not found in /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/module-two-factor-auth/Model/Provider/Engine/Google.php:120
Stack trace:
#0 /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/module-two-factor-auth/Model/Provider/Engine/Google.php(196): Magento\TwoFactorAuth\Model\Provider\Engine\Google->getTotp(Object(Magento\AdminAdobeIms\Model\User\Interceptor))
#1 /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/module-two-factor-auth/Controller/Adminhtml/Google/Authpost.php(144): Magento\TwoFactorAuth\Model\Provider\Engine\Google->verify(Object(Magento\AdminAdobeIms\Model\User\Interceptor), Object(Magento\Framework\DataObject))
#2 /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/framework/Interception/Interceptor.php(58): Magento\TwoFactorAuth\Controller\Adminhtml\Google\Authpost->execute()
#3 /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/framework/Interception/Interceptor.php(138): Magento\TwoFactorAuth\Controller\Adminhtml\Google\Authpost\Interceptor->___callParent('execute', Array)
#4 /var/www/share/staging-aws.xxx.com/releases/13/vendor/magento/framework/Interception/Interceptor.php(153): Magento\TwoFactorAuth\Controller\Adminhtml\Google\Authpost\Interceptor->Magento\Framework\Interception\{closure}()

If I change the invalidated crypt key in the env.php back to its old value, then Login with 2fa will work again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions