When I connect to SharePoint online using SharePointOnlineCredentials what type of authentication am I using? I don't think it is oauth.

Also the legacy authentication is being discontinued by MS. So will this way still work after that?

1 Answer 1


For how this will work, you will register an Azure AD app with the appropriate Graph API permissions (there is also the v1 API which uses Client ID/Secret, registered in SharePoint itself).

See Using CSOM for .NET Standard instead of CSOM for .NET Framework.

See SharePoint authentication for how SharePoint Online auth is performed. Essentially, you're issued a FedAuth cookie.

  • When passing the user and pwd to the clientcontext no browser interaction is present. Am I using oauth in this scenario or Federated authentication with AAD as the IDP? How does this relate to the legacy authentication setting in my tenant?
    – Danny
    Nov 11, 2020 at 15:50
  • Disabling Legacy Auth (which you should do along with disabling App Passwords) prevents the use of non-modern authentication mechanisms. But programmatically you shouldn't be using username/password, at least for non-interactive scenarios.
    – Trevor Seward
    Nov 11, 2020 at 16:04
  • We are using Azure AD app registrations for our non interactive stuff. I'm building a test case because we are having issues with PnP-PowerShell using the credential manager. When we execute a specific cmdlet and use the credential manager we get invalid refresh token errors. PnP also uses username and password from credential manager to build the clientcontext. So I want to test it using plain CSOM. I was just looking how authentication goes when using CSOM and passing SharePointOnlineCredentials.
    – Danny
    Nov 11, 2020 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.