Crm 2011 Aspx page DefaultNetworkCredentials properties are empty string

60 Views Asked by At

I have aspx page in Crm 2011. In Page_Load, I need to create IOrganizationService instance with calling user credentials. In GetOrgService Method, I notice that UserName and Password properties of ClientCredential are set as empty string.

 public static IOrganizationService GetOrgService(bool admin = false, string organization = null)
    {
        ClientCredentials credential = new ClientCredentials();
        credential.Windows.ClientCredential = admin ? new NetworkCredential(Globals.UserName, Globals.Password, Globals.Domain) : CredentialCache.DefaultNetworkCredentials;

        OrganizationServiceProxy orgServiceProxy = new OrganizationServiceProxy(new Uri(Globals.OrganizationServiceUrl), null, credential, null);

        return orgServiceProxy;            

    }

Any approach to solve that problem.

1

There are 1 best solutions below

0
On

It was about authentication configuration of application on ISV. After I set "Anonymous Authentication" disabled, problem was solved.