現在、ユーザーが認証されているかどうかを確認する方法がありますが、ASP.netアプリケーションでデフォルトのログインを使用してActiveDirectory認証を実装する必要があります。
私の現在の方法:
public bool IsAuthenticated(string user, string pass)
        {
            bool authenticated = false;
            string path = "LDAP://my path here";
            DirectoryEntry adsEntry = new DirectoryEntry(path);
            adsEntry.AuthenticationType = AuthenticationTypes.Secure;
            adsEntry.Username = user;
            adsEntry.Password = pass;
            DirectorySearcher adsSearcher = new DirectorySearcher(adsEntry);
            adsSearcher.Filter = "(sAMAccountName=" + user + ")";
            try
            {
                SearchResult adsSearchResult = adsSearcher.FindOne();
                authenticated = true;
                adsEntry.Close();
            }
            catch (Exception ex)
            {
                // Failed to authenticate. Most likely it is caused by unknown user
                // id or bad strPassword.
                //strError = ex.Message;
                adsEntry.Close();
            }
            return authenticated;
web.configにログイン機能を実装しようとすると、次のように書きました。
    <membership defaultProvider="MembershipADProvider">
      <providers>
        <add
          name="MembershipADProvider"
          type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, 
            Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                    connectionStringName="ADConnectionString"
                    />
      </providers>
    </membership>
をスローするため、LDAPサーバーに接続しているように見えますBad username or password valdiation error。一方、サーバーに接続しているのかどうかはわかりません。このサーバーは、3回の誤った認証試行の後、他のすべてのアプリケーションでユーザーをブロックしますが、これは発生していません。connectionUsername属性とconnectionPasswordweb.configを追加する必要があるのかLogin、ログイン時にコマンドに各ユーザー名/パスワードを入力させる必要があるのかわかりません。どんな助けでもいただければ幸いです。