Sharepoint Authentication using o365 token - .net core

1.8k Views Asked by At

I have a token generated by o365 authentication can I use the same token to make request to the SharePoint using .netcore

I have seen many blogs but those are working with .net (not working with .netcore)

Note : I used this dll which is used for Authentication of SharePoint 'AppForSharePointOnlineWebToolkit' Which add's TokenHelper.cs files to the project. This is adding the file in .net but not in .net core

ClientContext clientContext = TokenHelper.GetClientContextWithAccessToken(targetWeb, AccessToken);

1

There are 1 best solutions below

0
On

I recommend to use a ClientID/ClientSecret to authenticate with SharePoint: https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs. The one you are going to use was too old.