HttpListenerContext.User プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HttpListenerContext.User プロパティの意味・解説 

HttpListenerContext.User プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

要求が HttpListenerContext オブジェクトによって表されるクライアントID認証情報セキュリティ ロール取得するために使用するオブジェクト取得します

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

Dim instance As HttpListenerContext
Dim value As IPrincipal

value = instance.User
public IPrincipal User { get; }
public:
property IPrincipal^ User {
    IPrincipal^ get ();
}
/** @property */
public IPrincipal get_User ()

プロパティ
クライアント記述する IPrincipal オブジェクト。この HttpListenerContext提供した HttpListener が認証を必要としない場合null 参照 (Visual Basic では Nothing)。

解説解説

HttpListener は、AuthenticationSchemes プロパティ使用する場合、または AuthenticationSchemeSelectorDelegate プロパティ使用して AuthenticationSchemeSelector デリゲート指定する場合は、認証が必要であることを示します

クライアントログイン名と認証情報確認するには、このプロパティによって返されるオブジェクトの IPrincipal.Identity プロパティチェックします

使用例使用例

クライアントに関する ID認証情報アクセスし、それを応答クライアント返すコード例次に示します

public static string ClientInformation(HttpListenerContext
 context)
{
    System.Security.Principal.IPrincipal user = context.User;
    System.Security.Principal.IIdentity id = user.Identity;
    if (id == null)
    {
        return "Client authentication is not enabled for
 this Web server.";
    }
    
    string display;
    if (id.IsAuthenticated)
    {
        display = String.Format("{0} was authenticated using
 {1}", id.Name, 
            id.AuthenticationType);
    }
    else
    {
       display = String.Format("{0} was not authenticated", id.Name);
    }
    return display;
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HttpListenerContext クラス
HttpListenerContext メンバ
System.Net 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からHttpListenerContext.User プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHttpListenerContext.User プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHttpListenerContext.User プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「HttpListenerContext.User プロパティ」の関連用語

HttpListenerContext.User プロパティのお隣キーワード
検索ランキング

   

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



HttpListenerContext.User プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS