Crm 2011 Aspx页面DefaultNetworkCredentials属性为空字符串

时间:2015-06-17 14:04:54

标签: asp.net dynamics-crm-2011

我在Crm 2011中有aspx页面。在Page_Load中,我需要使用调用用户凭据创建IOrganizationService实例。 在GetOrgService方法中,我注意到ClientCredential的UserName和Password属性被设置为空字符串。

 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;            

    }

解决该问题的任何方法。

1 个答案:

答案 0 :(得分:0)

关于ISV上的应用程序的认证配置。在我设置"匿名身份验证"残疾人,问题解决了。

相关问题