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

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

HttpListener.AuthenticationSchemes プロパティ

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

クライアント認証使用する方式取得または設定します

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

Public Property AuthenticationSchemes As
 AuthenticationSchemes
Dim instance As HttpListener
Dim value As AuthenticationSchemes

value = instance.AuthenticationSchemes

instance.AuthenticationSchemes = value
public AuthenticationSchemes AuthenticationSchemes { get;
 set; }
public:
property AuthenticationSchemes AuthenticationSchemes {
    AuthenticationSchemes get ();
    void set (AuthenticationSchemes value);
}
/** @property */
public AuthenticationSchemes get_AuthenticationSchemes ()

/** @property */
public void set_AuthenticationSchemes (AuthenticationSchemes
 value)
public function get AuthenticationSchemes
 () : AuthenticationSchemes

public function set AuthenticationSchemes
 (value : AuthenticationSchemes)

プロパティ
クライアント認証方法を示す AuthenticationSchemes 列挙値のビットごとの組み合わせ既定値Anonymous です。

例外例外
例外種類条件

ObjectDisposedException

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

解説解説

HttpListener は、指定され方式使用してすべての受信要求認証します。GetContext メソッドおよび EndGetContext メソッドは、HttpListener正常に要求認証した場合だけ、受信クライアント要求返します

HttpListenerContext.User プロパティ使用して正常に認証されクライアントID確認できます

HttpListener オブジェクト受信した要求特性 (Url プロパティまたは UserHostName プロパティ) に応じて異な認証方式使用するようにするには、認証方式選択するメソッド実装する必要がありますこの方法の詳細については、AuthenticationSchemeSelectorDelegate プロパティドキュメント参照してください

メモメモ

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

使用例使用例

AuthenticationSchemes プロパティ使用して認証方式指定するコード例次に示します

public static void SimpleListenerWithUnsafeAuthentication(string[]
 prefixes)
{
    // URI prefixes are required,
    // for example "http://contoso.com:8080/index/".
    if (prefixes == null || prefixes.Length
 == 0)
      throw new ArgumentException("prefixes");
    // Set up a listener.
    HttpListener listener = new HttpListener();
    foreach (string s in
 prefixes)
    {
        listener.Prefixes.Add(s);
    }
    listener.Start();
    // Specify Negotiate as the authentication scheme.
    listener.AuthenticationSchemes = AuthenticationSchemes.Negotiate;
    // If NTLM is used, we will allow multiple requests on the same
    // connection to use the authentication information of first request.
    // This improves performance but does reduce the security of your
 
    // application. 
    listener.UnsafeConnectionNtlmAuthentication = true;
    // This listener does not want to receive exceptions 
    // that occur when sending the response to the client.
    listener.IgnoreWriteExceptions = true;
    Console.WriteLine("Listening...");
    // ... process requests here.

    listener.Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS