コード例 #1
0
        /// <summary>
        /// This method retrieves the current user from Azure AD
        /// </summary>
        /// <returns>The user retrieved from Azure AD</returns>
        public static LightGraphUser GetCurrentUser()
        {
            String jsonResponse = MicrosoftGraphHelper.MakeGetRequestForString(
                String.Format("{0}me",
                              MicrosoftGraphHelper.MicrosoftGraphV1BaseUri));

            if (jsonResponse != null)
            {
                var user = JsonConvert.DeserializeObject <LightGraphUser>(jsonResponse);
                return(user);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public ActionResult Index()
        {
            var me =
                MicrosoftGraphHelper.MakeGetRequestForString(MicrosoftGraphHelper.MicrosoftGraphV1BaseUri + "me");

            try
            {
                SPORemoteActions.ProvisionArtifactsByCode();
                SPORemoteActions.BrowseFilesLibrary();

                // PlayWithGroupsViaGraphAPI();
            }
            catch
            {
                // Skip exception for training purposes only
            }

            ViewBag.Current = "Index";
            return(View());
        }
コード例 #3
0
        public ActionResult Index()
        {
            var result = MicrosoftGraphHelper.MakeGetRequestForString("https://graph.microsoft.com/v1.0/me");

            return(View());
        }
コード例 #4
0
        public ActionResult Index()
        {
            var result = MicrosoftGraphHelper.MakeGetRequestForString(MSGraphAPIDemoSettings.MicrosoftGraphResourceId + "/v1.0/me");

            return(View());
        }