WindowsAuthenticationModule クラス

定義

Windows 認証が有効な場合、ASP.NET アプリケーションに対してユーザーの ID を設定します。 このクラスは継承できません。

public ref class WindowsAuthenticationModule sealed : System::Web::IHttpModule
public sealed class WindowsAuthenticationModule : System.Web.IHttpModule
type WindowsAuthenticationModule = class
    interface IHttpModule
Public NotInheritable Class WindowsAuthenticationModule
Implements IHttpModule
継承
WindowsAuthenticationModule
実装

次のコード例では、 WindowsAuthentication_OnAuthenticate イベントを使用して、 User 現在 HttpContext の の プロパティをカスタム IPrincipal オブジェクトに設定します。

public void WindowsAuthentication_OnAuthenticate(object sender, WindowsAuthenticationEventArgs args)
{
  if (!args.Identity.IsAnonymous)
  {
    args.User = new Samples.AspNet.Security.MyPrincipal(args.Identity);
  }
}
Public Sub WindowsAuthentication_OnAuthenticate(sender As Object, args As WindowsAuthenticationEventArgs)
  If Not args.Identity.IsAnonymous Then
    args.User = New Samples.AspNet.Security.MyPrincipal(args.Identity)
  End If
End Sub

注釈

認証Modeが にWindows設定されている場合、 WindowsAuthenticationModule は、現在HttpContextの 要求に対して IPrincipal IIS によって提供される Windows ID を表す オブジェクトに現在の の プロパティを設定Userします。 IIS で匿名認証を使用する WindowsAuthenticationModule 場合、 は メソッドによって返される ID を GetAnonymous 使用します。

WindowsAuthenticationModule、現在HttpContextの の Authenticate プロパティにカスタム IPrincipalUser オブジェクトを提供できるようにするイベントを公開します。 イベントに Authenticate アクセスするには、ASP.NET アプリケーションの Global.asax ファイルで WindowsAuthentication_OnAuthenticate という名前のサブルーチンを指定します。

Note

IIS 7.0 では、 クラスと クラスのFormsAuthenticationModule使用WindowsAuthenticationModuleはサポートされていません。 統合モードでの互換性の問題の詳細については、「 ASP.NET アプリケーションを IIS 6.0 から IIS 7.0 に移動する」を参照してください。

コンストラクター

WindowsAuthenticationModule()

WindowsAuthenticationModule クラスのインスタンスを作成します。

メソッド

Dispose()

WindowsAuthenticationModule で使用されていたすべてのリソース (メモリを除く) を解放します。

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
Init(HttpApplication)

WindowsAuthenticationModule オブジェクトを初期化します。

MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

イベント

Authenticate

アプリケーションが現在の要求を認証するときに発生します。

適用対象

こちらもご覧ください