I am creating a provider hosted app with my office 365 subscription. I created it as an asp.net MVC application and Modified the code according to this post
However I got this error in the token helper class, so I am clueless.
Update 1: WHen I initialize Visual Studio, and press F5 the first time in the app, VS asks me my office 365 credentials, however when debugging I see my account name on the Request object which is weird, I am thinking that could be the source of the issue but how to fix it?
Maybe my browser has that credential on memory:?
`
Update 2:
Code
[SharePointContextFilter]
public ActionResult Index()
{
Uri hostWeb = new Uri(Request.QueryString["SPHostUrl"]);
using(var clientContext=TokenHelper.GetS2SClientContextWithWindowsIdentity(hostWeb,Request.LogonUserIdentity))
{
var web= clientContext.Web;
clientContext.Load(web, w=>w.Lists.Include(l=>l.Title).Where(l=> !l.Hidden));
clientContext.ExecuteQuery();
return View(web.Lists);
}
}