AuthenticationSchemeSelector デリゲートとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > AuthenticationSchemeSelector デリゲートの意味・解説 

AuthenticationSchemeSelector デリゲート

メモ : このデリゲートは、.NET Framework version 2.0新しく追加されたものです。

HttpListener インスタンス認証方式選択します

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

Public Delegate Function
 AuthenticationSchemeSelector ( _
    httpRequest As HttpListenerRequest _
) As AuthenticationSchemes
Dim instance As New AuthenticationSchemeSelector(AddressOf
 HandlerMethod)
public delegate AuthenticationSchemes AuthenticationSchemeSelector
 (
    HttpListenerRequest httpRequest
)
public delegate AuthenticationSchemes AuthenticationSchemeSelector
 (
    HttpListenerRequest^ httpRequest
)
/** @delegate */
public delegate AuthenticationSchemes AuthenticationSchemeSelector
 (
    HttpListenerRequest httpRequest
)
JScript では、デリゲート使用できますが、新規に宣言することはできません。

パラメータ

httpRequest

認証方式選択対象となる HttpListenerRequest インスタンス

戻り値
指定したクライアント要求使用する認証メソッドを示す AuthenticationSchemes 値の 1 つ

解説解説

この種類デリゲートは、要求特性基づいて認証方式選択するために HttpListener インスタンスによって使用されます。

AuthenticationSchemeSelector デリゲートは、認証情報提供していない各受信要求HttpListenerRequest オブジェクト渡されます。このデリゲートによって呼び出されメソッドは、HttpListenerRequest オブジェクトおよび他の入手可能な情報使用して必要な認証方式決定します。このデリゲートは、AuthenticationSchemeSelectorDelegate プロパティ使用して指定されます。

使用例使用例

この種類インスタンス使用して AuthenticationSchemeSelectorDelegate プロパティ設定する例を次に示します

// 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;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「AuthenticationSchemeSelector デリゲート」の関連用語

AuthenticationSchemeSelector デリゲートのお隣キーワード
検索ランキング

   

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



AuthenticationSchemeSelector デリゲートのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS