WindowsAuthenticationEventArgs クラス

定義

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

public ref class WindowsAuthenticationEventArgs sealed : EventArgs
public sealed class WindowsAuthenticationEventArgs : EventArgs
type WindowsAuthenticationEventArgs = class
    inherit EventArgs
Public NotInheritable Class WindowsAuthenticationEventArgs
Inherits EventArgs
継承
WindowsAuthenticationEventArgs

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

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

注釈

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

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

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

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

コンストラクター

WindowsAuthenticationEventArgs(WindowsIdentity, HttpContext)

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

プロパティ

Context

現在の HTTP 要求に対する HttpContext オブジェクトを取得します。

Identity

WindowsAuthenticationEventArgs コンストラクターに渡される Windows ID を取得します。

User

現在の要求に関連付ける IPrincipal オブジェクトを取得または設定します。

メソッド

Equals(Object)

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

(継承元 Object)
GetHashCode()

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

(継承元 Object)
GetType()

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

(継承元 Object)
MemberwiseClone()

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

(継承元 Object)
ToString()

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

(継承元 Object)

適用対象

こちらもご覧ください