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

WindowsAuthenticationEventArgs クラス

WindowsAuthentication_OnAuthenticate イベントのデータを提供します。このクラスは継承できません。

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

Public NotInheritable Class
 WindowsAuthenticationEventArgs
    Inherits EventArgs
Dim instance As WindowsAuthenticationEventArgs
public sealed class WindowsAuthenticationEventArgs
 : EventArgs
public ref class WindowsAuthenticationEventArgs
 sealed : public EventArgs
public final class WindowsAuthenticationEventArgs
 extends EventArgs
public final class WindowsAuthenticationEventArgs
 extends EventArgs
解説解説

WindowsAuthenticationEventArgs クラスは WindowsAuthentication_OnAuthenticate イベントにイベント値を指定し、現在の要求に対するカスタムの Windows ID を指定できるようにするために使用されます。

WindowsAuthenticationModule は、IIS によって提供された Windows ID と現在の HttpContext を使用して WindowsAuthenticationEventArgs オブジェクトを構築し、それを WindowsAuthentication_OnAuthenticate イベントに渡します。

WindowsAuthentication_OnAuthenticate イベントに渡した WindowsAuthenticationEventArgs オブジェクトの User プロパティを使用して、現在の HttpContext の User プロパティにカスタムの IPrincipal オブジェクトを設定できます。WindowsAuthentication_OnAuthenticate イベント中に User プロパティ値が指定されない場合、IIS によって提供される Windows ID が現在の要求に対する ID として使用されます。IIS が匿名認証を使用する場合、Identity プロパティには、GetAnonymous メソッドによって返される ID が設定されます。

WindowsAuthentication_OnAuthenticate イベントは、認証 Mode が Windows に設定され、WindowsAuthenticationModule がアプリケーションのアクティブ HTTP モジュールである場合にのみ生成されます。

使用例使用例

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.EventArgs
    System.Web.Security.WindowsAuthenticationEventArgs
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

WindowsAuthenticationEventArgs コンストラクタ

WindowsAuthenticationEventArgs クラスの新しく作成されたインスタンスを初期化します。

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

Public Sub New ( _
    identity As WindowsIdentity, _
    context As HttpContext _
)
Dim identity As WindowsIdentity
Dim context As HttpContext

Dim instance As New WindowsAuthenticationEventArgs(identity,
 context)
public WindowsAuthenticationEventArgs (
    WindowsIdentity identity,
    HttpContext context
)
public:
WindowsAuthenticationEventArgs (
    WindowsIdentity^ identity, 
    HttpContext^ context
)
public WindowsAuthenticationEventArgs (
    WindowsIdentity identity, 
    HttpContext context
)
public function WindowsAuthenticationEventArgs
 (
    identity : WindowsIdentity, 
    context : HttpContext
)

パラメータ

identity

Windows の ID オブジェクト。

context

イベントのコンテキスト。

解説解説

WindowsAuthenticationModule は、IIS によって提供された Windows ID と現在の HttpContext を使用して WindowsAuthenticationEventArgs オブジェクトを構築し、それを WindowsAuthentication_OnAuthenticate イベントに渡します。

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

WindowsAuthenticationEventArgs プロパティ


パブリック プロパティパブリック プロパティ

参照参照

関連項目

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

その他の技術情報

Windows 認証プロバイダ

WindowsAuthenticationEventArgs メソッド


WindowsAuthenticationEventArgs メンバ

WindowsAuthentication_OnAuthenticate イベントのデータを提供します。このクラスは継承できません。

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


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド WindowsAuthenticationEventArgs WindowsAuthenticationEventArgs クラスの新しく作成されたインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

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

その他の技術情報

Windows 認証プロバイダ



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「WindowsAuthenticationEventArgs」の関連用語

WindowsAuthenticationEventArgsのお隣キーワード

   

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



WindowsAuthenticationEventArgsのページの著作権

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

©2026 GRAS Group, Inc.RSS