2014-06-11 2 views
0

asp.net에서 응용 프로그램 풀 ID를 사용하여 LDAPConnection과 AD를 어떻게 연결합니까?응용 프로그램 풀 ID를 사용하는 LDAP 연결

응용 프로그램이 LDAP 연결을 사용하여 AD에서 사용자 세부 정보를로드합니다. 현재 사용자 이름과 암호가의 Web.config에 저장되고 우리는 내가 ASP.Net을 사용하여 어떻게 Web.config의에서 자격 증명을 사용하는

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

대신 AD와 연결하기 위해 아래의 코드를 사용하는 AD와 연결하려면 AD를 연결하기위한 응용 프로그램 풀 ID?

답변

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); 
관련 문제