Share via

Why do we need NetworkCredential while targeting OnPremise via CSOM.

Amit Singh Rawat 731 Reputation points
2021-11-03T07:03:04.983+00:00

Why do we need NetworkCredential while targeting OnPremise via CSOM.. Can't we just use SharePointOnlineCredentials which we are using to target SPOnline or something common which can work for both online and onpremise.

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft 365 and Office | SharePoint Server | Development
0 comments No comments

Answer accepted by question author

RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
2021-11-04T02:40:15.417+00:00

Hi @Amit Singh Rawat ,
SharePoint Online and SharePoint On-premise based on different authentication methods. So we can't use same function to access both SharePoint Online and SharePoint On-premise.
Please refer to the following documents
https://learn.microsoft.com/en-us/sharepoint/security-for-sharepoint-server/authentication-overview
https://learn.microsoft.com/en-us/sharepoint/authentication


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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