ASP.NET ID マトリックス
公開日: 2004年9月7日 | 最終更新日: 2004年9月7日
トピック

 目的
 適用対象
 モジュールの使用方法
 要約
 IIS 匿名認証
 IIS 基本認証
 IIS ダイジェスト認証
 IIS 統合 Windows 認証

目的

このモジュールの目的は次のとおりです。

  • ASP.NET の ID を理解する。

適用対象

このモジュールは、次の製品およびテクノロジを対象としています。

Windows® 2000 Server SP3

Microsoft® .NET Framework SP2

Microsoft SQL Server 2000 SP2

モジュールの使用方法

このモジュールは、『セキュリティ保護された ASP.NET アプリケーションの構築』の参照モジュールです。ここには、このガイドの他のモジュールで取り上げたソリューションに対する理解を深めるための補足情報が記載されていますので、元のモジュールと併せてお読みください。

要約

プリンシパル オブジェクトは、IPrincipal インターフェイスを実装し、コードが代行するユーザーのセキュリティ コンテキストを表します。プリンシパル オブジェクトには、ユーザーの ID 情報 (IIdentity オブジェクトの内容) とユーザーが所属しているロールが格納されます。

ASP.NET には、以下のプリンシパル オブジェクトと ID オブジェクトの実装が用意されています。

  • WindowsPrincipal オブジェクトおよび WindowsIdentity オブジェクトは、Windows 認証で認証されたユーザーを表します。これらのオブジェクトでは、Windows ユーザーが所属している Windows グループのセットからロール リストが自動的に取得されます。

  • GenericPrincipal オブジェクトおよび GenericIdentity オブジェクトは、フォーム認証やその他のカスタム認証メカニズムで認証されたユーザーを表します。これらのオブジェクトでは、ロール リストが認証メカニズムに固有の方法で取得されます。多くの場合は、データベースから取得されます。

  • FormsIdentity オブジェクトはフォーム認証で認証されたユーザーを、PassportIdentity オブジェクトは Passport 認証で認証されたユーザーを表します。

この付録に収録されている表には、IIS 認証設定値の違いに応じて、IPrincipal オブジェクトまたは IIdentity オブジェクトを維持している各変数から取得される ID 情報を示しています。これらの表では、以下の略記表現を使用しています。

  • HttpContext = HttpContext.Current.User。現在の Web 要求に対応するセキュリティ情報を格納した IPrincipal オブジェクトを返します。これは、認証済みの Web クライアントです。

  • WindowsIdentity = WindowsIdentity.GetCurrent()。現在実行中の Win32® スレッドのセキュリティ コンテキストの ID 情報を返します。

  • Thread = Thread.CurrentPrincipal。Win32 スレッドの上位で、現在実行されている .NET スレッドのプリンシパルを返します。

IIS 匿名認証

Web.config の設定

変数の位置

取得される ID 情報

<identity impersonate="true"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

-
MACHINE\IUSR_MACHINE
-

<identity impersonate="false"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

-
MACHINE\ASPNET
-

<identity impersonate="true" />
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
MACHINE\IUSR_MACHINE
ユーザーが提供する名前

<identity impersonate="false"/>
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
MACHINE\ASPNET
ユーザーが提供する名前

IIS 基本認証

Web.config の設定

変数の位置

取得される ID 情報

<identity impersonate="true"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
Domain\UserName
Domain\UserName

<identity impersonate="false"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
MACHINE\ASPNET
Domain\UserName

<identity impersonate="true" />
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
Domain\UserName
ユーザーが提供する名前

<identity impersonate="false"/>
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
MACHINE\ASPNET
ユーザーが提供する名前

IIS ダイジェスト認証

Web.config の設定

変数の位置

取得される ID 情報

<identity impersonate="true"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
Domain\UserName
Domain\UserName

<identity impersonate="false"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
MACHINE\ASPNET
Domain\UserName

<identity impersonate="true" />
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
Domain\UserName
ユーザーが提供する名前

<identity impersonate="false"/>
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
MACHINE\ASPNET
ユーザーが提供する名前

IIS 統合 Windows 認証

Web.config の設定

変数の位置

取得される ID 情報

<identity impersonate="true"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
Domain\UserName
Domain\UserName

<identity impersonate="false"/>
<authentication mode="Windows" />

HttpContext
WindowsIdentity
Thread

Domain\UserName
MACHINE\ASPNET
Domain\UserName

<identity impersonate="true" />
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
Domain\UserName
ユーザーが提供する名前

<identity impersonate="false"/>
<authentication mode="Forms" />

HttpContext
WindowsIdentity
Thread

ユーザーが提供する名前
MACHINE\ASPNET
ユーザーが提供する名前


Page view tracker