public ActionResult UserProfile() { #if DEBUG ClaimsPrincipal.Current.DebugPrintAllClaims(); #endif string aadObjectIdOfUser = ClaimsPrincipal.Current.GetObjectId(); var graphOps = new GraphOperations(); graphOps.Initialize(); var user = graphOps.GetUser(aadObjectIdOfUser); var profile = new UserProfile() { DisplayName = user.DisplayName, GivenName = user.GivenName, Surname = user.Surname }; return(View(profile)); }