.NET Core SharePointOnlineCredentials class

developer sp1 461 Reputation points
2020-08-04T01:16:04.25+00:00

I'm using the latest CSOM library which should be supported .NET Core solution.
However, I can't find SharePointOnlineCredentials class when coding.

What's the required step to use it in .NET Core solution ?

Thanks for any help please :)

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,706 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Trevor Seward 11,681 Reputation points
    2020-08-04T01:53:19.197+00:00

    It has been removed. You shouldn't be using username/pass to access services via API. See https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard#using-modern-authentication-with-csom-for-net-standard for more information.


  2. Baker Kong-MSFT 3,791 Reputation points
    2020-08-04T06:22:44.513+00:00

    Hi developersp1-9584,

    It's not possible to use SharePointOnlineCredentials in CSOM for .NET Standard. Instead, it's recommended to use OAuth to acquire an access token.
    Here is a blog that demonstrates how to use OAuth 2.0 Resource Owner Password Credentials for fetching the token and use the token in CSOM:

    Best Regards,
    Baker Kong


  3. Marc Mora Gibert 1 Reputation point
    2020-08-12T15:42:30.963+00:00

    Hi, there's a way to get Sharepoint Authentication Cookie with this new Authentication model? With old SharepointOnlineCredentials , we used GetAuthenticationCookie method to get this, but with new system I don't know how can I get this. Is it posible?

    Thanks!