4

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?

  • I am not able to add AppForSharePointOnlineWebToolkit 3 in my visual studio 2013 – Mani Rudraraju May 23 '18 at 18:13
9

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

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, privacy policy and cookie policy

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