Sharepoint Basic auth authentication effect SharePointOnlineCredentials?

daniel GRILLO 20 Reputation points
2025-05-23T13:42:26.0333333+00:00

I'm wondering if the announcement of Basic auth deprecation for SP online mentioned here

https://learn.microsoft.com/en-us/sharepoint/technical-reference/basic-auth-is-being-deprecated

affects the use of the SharePointOnlineCredentials method of logging in via .net CSOM APIs.

 

I'm aware it takes username and password but I thought it was actually classified as a form of Claims Based Authentication not basic.

I  know on the client side, newer CSOM libs don't include that structure any more. But that doesn't mean the server will no longer accept that means of login.

 

The object I'm talking about is 

https://learn.microsoft.com/en-us/dotnet/api/microsoft.sharepoint.client.sharepointonlinecredentials.-ctor?view=sharepoint-csom&devlangs=csharp&f1url=%3FappId%3DDev16IDEF1%26l%3DEN-US%26k%3Dk(Microsoft.SharePoint.Client.SharePointOnlineCredentials.%23ctor)%3Bk(TargetFrameworkMoniker-.NETFramework%2CVersion%3Dv4.8)%3Bk(DevLang-csharp)%26rd%3Dtrue

 

And the means of using it would be like this

SharePointOnlineCredentials creds = new SharePointOnlineCredentials(sUserName, securePassword);

ClientContext ctx.Credentials = creds;

string authCooke = creds.GetAuthenticationCookie(Sharepointuri);

I'm wondering if that type of authentication is what is being deprecated with that announcement. I know you want to say "Please use more modern login methods". I agree. But that is not the question I'm asking.

The question is, "is the method of login described above, being deprecated according to the announcement mentioned"

Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2025-05-23T23:30:03.1566667+00:00

    SharePointOnlineCredentials supports Kerberos, Ntlm and basic authentication. So it will not work with SharePoint online after basic support is dropped. For SharePoint online you should be switching to access tokens.

    With access tokens you call the azure ad to get the token. If you want a user token, then a web browser is used to login to ad and get the token. You can also use an application clientid and secret (know as password flow) to login as an application (not a user) without a browser.

    see docs

    https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.