Forum Discussion
Authenticating to SharePoint Online site using CSOM
Hello,
We have federated authentiation in our org and i am trying to connect to SharePoint site using CSOM with SharePoint Online credentials but getting an error. Here is the error message;
Microsoft.SharePoint.Client.IdcrlException: The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios. Anyone know a solution to this problem.
I've seen this error more than once. In most cases I just typed username / password wrong. Federated authentication should not be a problem but have you considered using App Credentials also? Are you using Multi-factor authentication?
PnP's AuthenticationManager Class provides some usefull utility methods to obtain an authenticated context in different ways. Could you try using GetWebLoginClientContext for getting an authenticated context?
https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManager.cs
8 Replies
- paulpaschaBronze Contributor
I've seen this error more than once. In most cases I just typed username / password wrong. Federated authentication should not be a problem but have you considered using App Credentials also? Are you using Multi-factor authentication?
PnP's AuthenticationManager Class provides some usefull utility methods to obtain an authenticated context in different ways. Could you try using GetWebLoginClientContext for getting an authenticated context?
https://github.com/SharePoint/PnP-Sites-Core/blob/master/Core/OfficeDevPnP.Core/AuthenticationManager.cs
- Chris StewartBrass Contributor
It looks like we are facing a similar issue, but have asked in different parts of the forum. https://techcommunity.microsoft.com/t5/SharePoint/Using-SharePoint-Client-Side-Object-Model-with-PowerShell-and/m-p/92734#M8667
I'll let know if I find anything.- Vijaya VellabatiCopper Contributor
Thanks Chris, i am glad that i am not the only one with this issue.