Quantcast
Channel: Forum CRM Development
Viewing all articles
Browse latest Browse all 1000

Can I disable the login prompt for MS CRM 2011 SDK if credentials are wrong?

$
0
0
Right now I access the CRM SDK as follows

    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?

Viewing all articles
Browse latest Browse all 1000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>