5

After login with correct credential, I cannot login into admin panel. Here is the error message I am getting:

1 exception(s):
Exception #0 (Exception): Notice: Undefined offset: 2 in D:\Xampp\htdocs\demo\webses\projname\vendor\magento\framework\Encryption\Encryptor.php on line 588
Dharman
  • 30,962
  • 25
  • 85
  • 135
prasanth
  • 53
  • 1
  • 1
  • 3

6 Answers6

15

I had the same issue. Resolved it by creating a new admin user using terminal and using that new user to login backend.

php bin/magento admin:user:create --admin-user=john --admin-password=doe123445 \
  --admin-email=hi@mydomian.com --admin-firstname=John --admin-lastname=Doe
Paul Roub
  • 36,322
  • 27
  • 84
  • 93
8

I installed the sodium extension for PHP and after restarting PHP and nginx this error no longer appeared. My version of PHP is PHP 7.1.30 and the command I ran was:

sudo apt-get install php7.1-sodium -y
  • 3
    This error occurs when you have an admin user from an environment that contained libsodium and your current environment does not. To resolve, enable the sodium extension. – Navarr Feb 10 '20 at 12:35
  • did it for me. thank you. In my case it might be the "problem" that I installed magento with php7.3 but the www runtime runs in php7.1 – cljk Sep 28 '20 at 09:45
4

Usually, it happens when you get a database from another environment with the different PHP version, and admin user has been created there. E.g. you have PHP 7.1 and the admin user has been created with PHP 7.2. Just create the user in your environment or switch to the same PHP version.

Vladishev
  • 101
  • 4
2

I had same issue and creating new user did not help me. However, updating the password and clearing cache worked for me. I used below SQL to update my password:

UPDATE admin_user SET password = CONCAT(SHA2('xxxxxxxxNewPassword', 256), ':xxxxxxxx:1') WHERE username = 'username';
Dharman
  • 30,962
  • 25
  • 85
  • 135
2

update admin password in admin_user table "6f92815f581710d238a9837aa079e722dd5bec27e6717cfa6c691f04b4993797:ZrBkBsjOa8M5izHd4qjhXsSG1uGZgPZY:1". this password is "admin123"

Vipin Garg
  • 466
  • 3
  • 15
0

after upgrade magento 2.x.x to to any higher version you should first Make sure you run the upgrade command php bin/magento setup:upgrade php bin/magento setup:setup:static-content:deploy -f php bin/magento setup:di:compile

if stile error exists check your php version it should be 7.2.x hope it will solve your issue!

Zuby
  • 111
  • 4