I'm glad to hear you solve the problem, if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.
By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". So, I would make a brief summary of this thread.
You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!
[The sign-in name or password does not match one in the Microsoft account system]
Issue Symptom:
When OP try locally, console app project shows me this error: "The sign-in name or password does not match one in the Microsoft account system".
What OP tried:
Manually login to the SharePoint website by using the same account and password. It is able to login and able to access to the folder.
Login to the SharePoint website by using the same account and password, it does not request to verify with phone call, SMS etc. So, OP suspects this account is not enabled MFA.
Below is code:
using (ClientContext ctx = new ClientContext(ConfigurationManager.AppSettings.Get("SharePointApiUrl")))
{
string password = ConfigurationManager.AppSettings.Get("SharePointPassword");
string account = ConfigurationManager.AppSettings.Get("SharePointAccount");
var secret = new System.Security.SecureString();
foreach (char c in password)
{ secret.AppendChar(c);
}
ctx.Credentials = new SharePointOnlineCredentials(account, secret);
ctx.Load(ctx.Web);
ctx.ExecuteQuery();
Current status:
OP solved this. OP excluded the user from Legacy Authentication.
Here is the reference: https://help.orchid.systems/sage300addons/Content/Shared/ModuleOptions/Office365-Legacy-Authentication.htm