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.
It was about authentication configuration of application on ISV. After I set "Anonymous Authentication" disabled, problem was solved.