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

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

HttpListener.AuthenticationSchemeSelectorDelegate プロパティ

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

クライアント認証使用するプロトコル確認するために呼び出されるデリゲート取得または設定します

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

Public Property AuthenticationSchemeSelectorDelegate
 As AuthenticationSchemeSelector
Dim instance As HttpListener
Dim value As AuthenticationSchemeSelector

value = instance.AuthenticationSchemeSelectorDelegate

instance.AuthenticationSchemeSelectorDelegate = value
public AuthenticationSchemeSelector AuthenticationSchemeSelectorDelegate
 { get; set; }
public:
property AuthenticationSchemeSelector^ AuthenticationSchemeSelectorDelegate {
    AuthenticationSchemeSelector^ get ();
    void set (AuthenticationSchemeSelector^
 value);
}
/** @property */
public AuthenticationSchemeSelector get_AuthenticationSchemeSelectorDelegate
 ()

/** @property */
public void set_AuthenticationSchemeSelectorDelegate
 (AuthenticationSchemeSelector value)
public function get AuthenticationSchemeSelectorDelegate
 () : AuthenticationSchemeSelector

public function set AuthenticationSchemeSelectorDelegate
 (value : AuthenticationSchemeSelector)

プロパティ
認証プロトコル選択使用されるメソッド呼び出す AuthenticationSchemeSelector デリゲート既定値null 参照 (Visual Basic では Nothing) です。

例外例外
例外種類条件

ObjectDisposedException

このオブジェクト閉じられています。

解説解説
メモメモ

HttpListener の特定のインスタンス処理されるすべての要求に対して同じ認証プロトコル使用する場合は、このプロパティ設定する要はありません。すべてのクライアント要求に対して使用するプロトコル指定するには、AuthenticationSchemes プロパティ使用します

クライアントヘッダー認証情報指定してない場合HttpListener は、未認証の各受信要求について、指定されデリゲート呼び出してクライアント認証使用するプロトコル (存在する場合) を決定します。GetContext メソッドおよび EndGetContext メソッドは、HttpListener正常に要求認証した場合だけ、受信要求返します要求認証できない場合HttpListener は、自動的に 401 応答返します。System.Net.HttpListenerRequest.LogonUserIdentity プロパティ使用して正常に認証されクライアントID取得できます

認証プロトコル選択アプリケーション固有のメソッドデリゲートする機能は、HttpListenerインスタンスに、受信した要求特性 (要求Url プロパティや UserHostAddress プロパティなど) に応じて異な認証プロトコル使用する場合に便利です。

メモメモ

このプロパティ設定して DigestNTLM、または Negotiate有効にするには、SecurityPermission と ControlPrincipal が必要です。

使用例使用例

このプロパティの値を設定するコード例次に示します

// Set up a listener.
HttpListener listener = new HttpListener();
HttpListenerPrefixCollection prefixes = listener.Prefixes;
prefixes.Add(@"http://localhost:8080/");
prefixes.Add(@"http://contoso.com:8080/");

// Specify the authentication delegate.
listener.AuthenticationSchemeSelectorDelegate = 
    new AuthenticationSchemeSelector (AuthenticationSchemeForClient);

// Start listening for requests and process them 
// synchronously.
listener.Start();

AuthenticationSchemeSelector デリゲートによって呼び出されるメソッド実装提供するコード例次に示します

static AuthenticationSchemes AuthenticationSchemeForClient(HttpListenerRequest
 request)
{
    Console.WriteLine("Client authentication protocol selection in
 progress...");
    // Do not authenticate local machine requests.
    if (request.RemoteEndPoint.Address.Equals (IPAddress.Loopback))
    {
        return AuthenticationSchemes.None;
    }
    else
    {
        return AuthenticationSchemes.IntegratedWindowsAuthentication;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS