This is a painful error that pretty much has zero results on google. It happens the moment you try to get a context from a SharePoint redirect to your web application. A quick google, there is a blog post for this that references something misconfigured in the Office 365 side:
But there is something else going on. If your version of Visual Studio and Office Developer tools does not match office 365 (which is on RTM now) you will get this error! In my case, I had the RTM of Visual Studio 2012, but a back level of the Office Developer Tools.
After updating all Development tools to RTM version this went away! But note, the error will ALWAYS occur the first time you hit the HTTPS web application (the one where you click the exception for the certificate). Try a second time and the token will actually exist and the app will run.
Another error that will disappear is the dreaded (also reference this post for information on this error):
Microsoft.SharePoint.SPException: The Azure Access Control service is unavailable
These don't display in S2S configured applications (using Windows Auth) so these apps won't display these errors.
Chris