5

I have been reading several articles to get SharePoint Online client context with the generated access token. All of them use TokenHelper class to get the client context as shown below:

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

My question is how do we access TokenHelper class? I could not find it in the reference Microsoft.SharePoint.Client version 16.1.0.0. What reference do we need to add to access this class?

1
  • I am not able to add AppForSharePointOnlineWebToolkit 3 in my visual studio 2013 May 23, 2018 at 18:13

2 Answers 2

11

Just add the NuGet package AppForSharePointOnlineWebToolkit. It will add the TokenHelper.cs and SharePointContext.cs files to your project.

0
4

Make Sure that you installed Office developer Tools and SharePoint Server 2013 Client Components SDK

We don't need any external Reference for the SharePointContext.cs and TokenHelper.cs files. Once we create the provider hosted app, they will come in the VS Web Project automatically.

If they are not present in the Provider hosted app Web project, please re install the Office developer Tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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