// // GET: ToDoList public async Task <ActionResult> Index() { string accessToken = await GetAccessToken(); await RESTAPIHelper.LoadWorkbook(accessToken); return(View(await RESTAPIHelper.GetToDoItems(accessToken))); }
// // GET: ToDoList public async Task <ActionResult> Index() { string userObjId = System.Security.Claims.ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/objectidentifier").Value; SessionTokenCache tokenCache = new SessionTokenCache(userObjId, HttpContext); string tenantId = System.Security.Claims.ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/tenantid").Value; string authority = "common"; AuthHelper authHelper = new AuthHelper(authority, ConfigurationManager.AppSettings["ida:AppId"], ConfigurationManager.AppSettings["ida:AppSecret"], tokenCache); string accessToken = await authHelper.GetUserAccessToken(Url.Action("Index", "Home", null, Request.Url.Scheme)); await RESTAPIHelper.LoadWorkbook(accessToken); return(View(await RESTAPIHelper.GetToDoItems(accessToken))); }