Spelunking with the SharePoint 2013 App AppContext Tokens and StandardTokens

When writing SharePoint 2013 Provider hosted (autohosted too), SharePoint 2013 Apps provide an App context token, along with other information as part of the initial transition to the provider.  That token, and supporting “tokens” (part of the {standardtoken}) are useful to understand what you have and what you can do wit them.

In the interest of having a simple MVC4 based site, that provides simple Model binding of the SP 2013 App context transition, the sample app in the github repository provides some simple token information, along with a couple CSOM calls back to the SP 2013 environment.

This is purely for getting a better understanding of what’s part of the SP 2013 AppContext, the JwT token, and a simple way to manage this under an MVC4 ASP.NET app.

Here are a couple screen shots:

Source code located here: https://github.com/cicorias/sharepointApps/tree/master/jwtSamples/jwtTokenDump 

Note that there is a hack in there that allows use of HttpSession for keeping the token around.  I didn’t want to much complexity with a cache provider.

SNAGHTML117c637e

SNAGHTML117c9326

SNAGHTML117cbfc1

 

SNAGHTML117ce589