How can I get Current Logged in user of SharePoint Site in Provider Hosted App's code behind?
I tried this:
clientContext.Load(clientContext.Web, web => web.CurrentUser.LoginName); clientContext.ExecuteQuery(); var login_nm = clientContext.Web.CurrentUser.LoginName;
userName = Request.LogonUserIdentity.Name.ToString();
string u_nm = User.Identity.Name.ToString();
But what I am getting is current System User. Not the SharePoint user. Above all the Options are to get the Windows User Identity. Not for SharePoint site. What should I do to get SharePoint user in my App.