【问题标题】:LDAP Connection using app pool identity使用应用程序池标识的 LDAP 连接
【发布时间】:2014-06-11 12:36:58
【问题描述】:

如何使用 asp.net 中的应用程序池标识将 AD 与 LDAPConnection 连接。

应用程序正在使用 LDAP 连接从 AD 加载用户详细信息。目前要连接 AD,用户名和密码存储在 web.config 中,我们使用以下代码连接 AD

// Create an LDAP connection to the server
LdapConnection connection = new LdapConnection(ldapServerName);
NetworkCredential networkCredential = new NetworkCredential(userName, password, domainName);
connection.Bind(networkCredential);

我如何使用 ASP.Net 应用程序池身份来连接 AD,而不是使用来自 web.config 的凭据?

【问题讨论】:

    标签: asp.net active-directory ldap


    【解决方案1】:

    使用 System.Net.CredentialCache.DefaultNetworkCredentials

    LdapConnection connection = new LdapConnection(ldapServerName);
    connection.SessionOptions.Sealing = true; // Using Kerberos 
    connection.SessionOptions.Signing = true; // Using Kerberos 
    connection.Bind(CredentialCache.DefaultNetworkCredentials);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-12-14
      • 2011-08-02
      • 1970-01-01
      • 1970-01-01
      • 2013-04-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多