Hello,
After installing Magento 2, I tried to log in as Admin using the --admin-user and --admin-password parameter's values, but I failed and got the following error messages.
- Error message
The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.
- Error message of Firefox's development tool
Content-Security-Policy: This site (http://localhost) has a Report-Only policy without a report-uri directive nor a report-to directive. CSP will not block and cannot report violations of this policy.
Regard
Solved! Go to Solution.
Hello
The problem has been resolved after remove semicolon from the beginning of the line ;extension=sodium from php.ini which enables it.
Hi @hossammaghbcbe ,
You can try below
php bin/magento admin:user:create --admin-user='xyz' --admin-password='xyz@123' --admin-email='xyz@gmail.com' --admin-firstname='Xyz' --admin-lastname='Xyz'
As its in your local, you can try random email id to check problem still persist or not.
Problem Solved? Accept as solution.
Thanks & Regards
Hello @Ankit Jasani
I got the following error when I tried your command and got this error: cache_dir "/srv/http/magento2/var/page_cache" is not writable. So I used sudo to run it, and it ran correctly, and I got a confirmation message: Created Magento administrator user named xyz. But when I tried the new user and password, I got the same error: The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later.
Please advise.
Hi @hossammaghbcbe ,
As setup is in your local system environment, you can try below command once
1) Execute below commands from magento root folder
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento s:s:d -f
sudo chmod 777 -R app/ pub/ generated/ var/
Check admin login again, if it's still same issue try 2nd option
2)
Find 'Magento_TwoFactorAuth' in app/etc/config.php
Change value from 1 to
Like 'Magento_TwoFactorAuth' => 0,
Execute below commands from magento root folder
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento s:s:d -f
sudo chmod 777 -R app/ pub/ generated/ var/
Check admin login again, if it's still same issue try 3rd option
3) core_config_data table make entry like below
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento s:s:d -f
sudo chmod 777 -R app/ pub/ generated/ var/
Check again problem solved or not.
Also check var/log/system.log & var/log/exception.log
Note: In case above not worked,you can try below as well.
Currently you are running with localhost, ideally I suggest to run with domain like http://test.magento.test
and add one more entry in core_config_data table
default | 0 | web/cookie/cookie_domain | .magento.test
sudo php bin/magento setup:upgrade
sudo php bin/magento setup:di:compile
sudo php bin/magento s:s:d -f
sudo chmod 777 -R app/ pub/ generated/ var/
The four solutions are not working. Please advise
Also, If my keyboard language isn't en_US, can the change cause this problem?
Regards
When you see “The account sign-in was incorrect or your account is disabled temporarily,” it usually means either the account really isn’t what you think it is, or Magento has locked it after too many failed attempts. Here’s a quick checklist to get you back in:
Verify the Admin User Exists
Run:
Make sure the username shown here exactly matches the one you passed to --admin-user. Typos or case differences will fail.
Reset the Admin Password
If you can’t remember the exact password you set (or want to be sure), reset it with:
Unlock the Account
Magento locks out an admin after a few failed logins. Clear that lock with:
Clear Cache, Sessions & Cookies
Flush Magento caches:
Delete var/session (or var/session/*) and var/page_cache/*
In your browser, fully clear cookies for localhost or whichever domain you’re using.
Check Your Base URL & Cookie Settings
If you’re on http://localhost:8080/ but your Base URL in Stores → Configuration → Web is set to http://localhost/, cookies won’t match and the login will silently fail. Make sure your Base URL and Cookie Domain exactly match your testing URL.
Disable Any Report-Only CSP Temporary
The Firefox CSP warning is harmless—Report-Only mode doesn’t block anything—so you can ignore it for now. It isn’t why your login is failing.
Once you’ve reset the password, unlocked the account, cleared caches and cookies, and confirmed your Base URL/cookie settings, you should be able to log in with the new credentials immediately. If it still fails, double-check your env.php for the correct table prefixes or look in the admin_user table directly to confirm your changes took effect.
I also faced the same issue with this site but then I wan able to get it back on track.