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 What reference do we need to add to access this class?

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

2 Answers 2


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


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 you have read our privacy policy.

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