/// <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); } }
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()); }
public ActionResult Index() { var result = MicrosoftGraphHelper.MakeGetRequestForString("https://graph.microsoft.com/v1.0/me"); return(View()); }
public ActionResult Index() { var result = MicrosoftGraphHelper.MakeGetRequestForString(MSGraphAPIDemoSettings.MicrosoftGraphResourceId + "/v1.0/me"); return(View()); }