asp.net.In 프로젝트에서 하나의 웹 응용 프로그램을 만들었습니다. 인증은 database.But에서 사용자 이름과 암호를 일치 시켜서 수행되었습니다. 이제 클라이언트는 Active Directory의 도움으로 응용 프로그램에서 자동 로그인을 요청합니다. 입증. 고객이 인증을 위해 AD에서 사용자의 이메일 ID를 사용하도록 권유합니다. 더 나아가 IActive Directory 인증
System.Security.Principal.WindowsIdentity wi = System.Security.Principal.WindowsIdentity.GetCurrent();
string[] a = Context.User.Identity.Name.Split('\\');
System.DirectoryServices.DirectoryEntry ADEntry = new System.DirectoryServices.DirectoryEntry("WinNT://" + a[0] + "/" + a[1]);
string Name = ADEntry.Properties["FullName"].Value.ToString();
:
가 나는 사용자의 전체 이름을 가져올 수 있지만, 나는 이메일 ID를 가져올 수 없습니다, 광고에 레코드를 가져 오기 위해 시도 나는 코드를 시도 DirectorySearcher를 사용하지만 Coulnot이 클라이언트 서버의 레코드를 검색하는 오류가 발생합니다 ..