Right now I access the CRM SDK as follows
However, if the domain credentials are incorrect, a Windows login prompt appears (somewhere in service.Execute). I don't want that login prompt. I have worked around this issue by validating the credentials using PrincipalContext before passing them to the DiscoveryServiceProxy, but I'm not entirely happy with that, as it does not work for IFD accessed from another domain.
Is there a way to disable the login prompt?
IServiceManagement<IDiscoveryService> serviceManagement = ServiceConfigurationFactory.CreateManagement<IDiscoveryService>(discoveryUri); ClientCredentials credentials = new ClientCredentials(); credentials.Windows.ClientCredential = new System.Net.NetworkCredential(userName, password, domain); using (DiscoveryServiceProxy serviceProxy = new DiscoveryServiceProxy(new DiscoveryServiceProxy(serviceManagement, credentials)) { RetrieveOrganizationsRequest orgRequest = new RetrieveOrganizationsRequest(); RetrieveOrganizationsResponse orgResponse = (RetrieveOrganizationsResponse)service.Execute(orgRequest); // do something with organisations }
However, if the domain credentials are incorrect, a Windows login prompt appears (somewhere in service.Execute). I don't want that login prompt. I have worked around this issue by validating the credentials using PrincipalContext before passing them to the DiscoveryServiceProxy, but I'm not entirely happy with that, as it does not work for IFD accessed from another domain.
Is there a way to disable the login prompt?