Forum Discussion
spaieszambiacom
Oct 04, 2022Copper Contributor
Sharepoint online CSOM error
Hello, I've been trying this simple CSOM code: string siteCollectionUrl = "https://ieszambia.sharepoint.com/"; string userName = "mailto:email address removed for privacy reasons"; string passw...
- Oct 04, 2022
spaieszambiacom
Mhm.... i normally use the "PnP.Framework" Library and this code
SecureString securePassword = new NetworkCredential("", password).SecurePassword;PnP.Framework.AuthenticationManager auth = new PnP.Framework.AuthenticationManager(username,securePassword);ClientContext ctx = auth.GetContext(siteUrl);
ganeshsanap
Oct 04, 2022MVP
spaieszambiacom If multi-factor authentication (MFA) is enabled for this user account, use M365 app password instead of normal password.
Check below threads for more information:
- Use App Password to Authenticate with PowerShell PnP
- Connect-SPOService : The sign-in name or password does not match one in the Microsoft account system
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- spaieszambiacomOct 04, 2022Copper ContributorHi ganeshsanap,
Thank you for your quick response. Thats thing. MFA is actually disabled. Thats why itsdriving me crazy. Do you have any other suggestions?
Kind Regards- SvenSieverdingOct 04, 2022Bronze Contributor
spaieszambiacom
Mhm.... i normally use the "PnP.Framework" Library and this code
SecureString securePassword = new NetworkCredential("", password).SecurePassword;PnP.Framework.AuthenticationManager auth = new PnP.Framework.AuthenticationManager(username,securePassword);ClientContext ctx = auth.GetContext(siteUrl);- spaieszambiacomOct 04, 2022Copper ContributorThank you very very much. This as worked. You've saved me a great headache. Thank you