RE: connect external web application to my crm 2016 on-permis in IFD mode
Hi,
Try this code-
===========
public void TestWhoAmI()
{
string _organizationURI;
OrganizationServiceProxy service;
ClientCredentials _credential = new ClientCredentials();
_credential.UserName.UserName = "<domai>\\<username>";
_credential.UserName.Password = "<password>";
_organizationURI = "https://<servername:port>/XRMServices/2011/Organization.svc";
using (service = new OrganizationServiceProxy(new Uri(_organizationURI), null, _credential, null))
{
var userId = ((WhoAmIResponse)service.Execute(new WhoAmIRequest())).UserId;
Console.WriteLine(((WhoAmIResponse)service.Execute(userId);
}
}
====================
Hope this helps.