コード例 #1
0
        // GET: Files
        public async Task<ActionResult> Index()
        {
            List<File> myFiles = new List<File>();
            FileService _fileService = new FileService();
            try
            {
                myFiles = await _fileService.GetMyFilesAsync();
            }
            catch (AdalException e)
            {

                if (e.ErrorCode == AdalError.FailedToAcquireTokenSilently)
                {

                    //This exception is thrown when either you have a stale access token, or you attempted to access a resource that you don't have permissions to access.
                    throw e;

                }

            }
            return View(myFiles);
        }