WindowsAuthenticationModuleとは? わかりやすく解説

WindowsAuthenticationModule イベント


パブリック イベントパブリック イベント

参照参照

関連項目

WindowsAuthenticationModule クラス
System.Web.Security 名前空間

その他の技術情報

Windows 認証プロバイダ
Global.asax 構文

WindowsAuthenticationModule クラス

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

名前空間: System.Web.Security
アセンブリ: System.Web (system.web.dll 内)
構文構文

Public NotInheritable Class
 WindowsAuthenticationModule
    Implements IHttpModule
Dim instance As WindowsAuthenticationModule
public sealed class WindowsAuthenticationModule
 : IHttpModule
public ref class WindowsAuthenticationModule
 sealed : IHttpModule
public final class WindowsAuthenticationModule
 implements IHttpModule
public final class WindowsAuthenticationModule
 implements IHttpModule
解説解説

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

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

使用例使用例

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

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
public void WindowsAuthentication_OnAuthenticate(object
 sender, WindowsAuthenticationEventArgs args)
{
  if (!args.Identity.IsAnonymous)
  {
    args.User = new Samples.AspNet.Security.MyPrincipal(args.Identity);
  }
}
.NET Framework のセキュリティ.NET Framework のセキュリティ
継承階層継承階層
System.Object
  System.Web.Security.WindowsAuthenticationModule
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WindowsAuthenticationModule メンバ
System.Web.Security 名前空間
その他の技術情報
Windows 認証プロバイダ
Global.asax 構文

WindowsAuthenticationModule コンストラクタ

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

名前空間: System.Web.Security
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As New WindowsAuthenticationModule
public WindowsAuthenticationModule ()
public:
WindowsAuthenticationModule ()
public WindowsAuthenticationModule ()
public function WindowsAuthenticationModule
 ()
解説解説

このコンストラクタは、アプリケーション コードから呼び出すためのものではありません。

ASP.NET は、このコンストラクタを呼び出して、WindowsAuthenticationModule クラスのインスタンスを作成します。コンストラクタを呼び出すと、コンストラクタは Init メソッドを呼び出して新しい WindowsAuthenticationModule オブジェクトを初期化します。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WindowsAuthenticationModule クラス
WindowsAuthenticationModule メンバ
System.Web.Security 名前空間
その他の技術情報
Windows 認証プロバイダ

WindowsAuthenticationModule メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
参照参照

関連項目

WindowsAuthenticationModule クラス
System.Web.Security 名前空間

その他の技術情報

Windows 認証プロバイダ
Global.asax 構文

WindowsAuthenticationModule メンバ

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

WindowsAuthenticationModule データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WindowsAuthenticationModule WindowsAuthenticationModule クラスのインスタンスを作成します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
パブリック イベントパブリック イベント
参照参照

関連項目

WindowsAuthenticationModule クラス
System.Web.Security 名前空間

その他の技術情報

Windows 認証プロバイダ
Global.asax 構文



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「WindowsAuthenticationModule」の関連用語

WindowsAuthenticationModuleのお隣キーワード

   

英語⇒日本語
日本語⇒英語
   



WindowsAuthenticationModuleのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS