In this tutorial, I will explain how to fix the error “the sign-in name or password does not match one in the Microsoft account system.” This error occurs when working with CSOM in SharePoint Online.
I recently tried to bind SharePoint list templates to a dropdown list using the client-side object model (csom) in SharePoint Online using Visual Studio. While retrieving list items it gave below error: Microsoft.SharePoint.Client.IdcrlExpection: The sign-in name or password does not match one in the Microsoft account system. The error looks like below:

I was using the below csom code to retrieve items from a SharePoint list.
void BindItemsToDropDownList()
{
using (ClientContext clientContext = new ClientContext("https://tsinfo.sharepoint.com/sites/Marketing"))
{
clientContext.AuthenticationMode = ClientAuthenticationMode.Default;
clientContext.Credentials = new SharePointOnlineCredentials("[email protected]", GetSPOSecureStringPassword());
Web web = clientContext.Web;
ListTemplateCollection templateColl = web.ListTemplates;
clientContext.Load(templateColl);
clientContext.ExecuteQuery();
//Further Code
}
}
private SecureString GetSPOSecureStringPassword()
{
try
{
var secureString = new SecureString();
foreach (char c in "YourAccountPassword")
{
secureString.AppendChar(c);
}
return secureString;
}
catch
{
throw;
}
}
}The sign-in name or password does not match one in the Microsoft account system
The error was coming because the Password was not correct for the Microsoft 365 account user name I was trying.
The problem was that I had not used that account for a long time, so the account password had expired already. So I had to reset my Microsoft 365 account password and then update the new password in the csom code. Then it started working.
Once I entered the correct password, the error “the sign-in name or password does not match one in the Microsoft account” disappeared.
I hope this SharePoint tutorial helps to solve the sign-in name or password does not match one in the Microsoft account system error in SharePoint.
You may like the following SharePoint tutorials:
- SharePoint Online jsom examples
- Save site as template in SharePoint
- SPServices in SharePoint
- Redirect SharePoint Site To New URL
- SharePoint Rest API Tutorial and Examples

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.
One other possibility for this error that I would like to add, is when Multi Factor Authentication is enabled. When your username and password is correct, you can still run into this.
This is especially hard to identify when MFA only kicks in when certain conditions are met, ex. when you are not on your company network. In this way the scenario can work from your own machine, but when you deploy it to Azure it will fail with the same username and password combination.
how can we resolve this with user name password and siteurl to authenticate MFA enabled users.
Leaving out the credential in case of 2FA being enabled works too!
Hello Jeremy! Can you explain that method?