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

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

WebRequest.AuthenticationLevel プロパティ

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

この要求使用する認証レベルおよび偽装レベルを示す値を取得または設定します

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

Public Property AuthenticationLevel As
 AuthenticationLevel
Dim instance As WebRequest
Dim value As AuthenticationLevel

value = instance.AuthenticationLevel

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

/** @property */
public void set_AuthenticationLevel (AuthenticationLevel
 value)
public function get AuthenticationLevel
 () : AuthenticationLevel

public function set AuthenticationLevel
 (value : AuthenticationLevel)

プロパティ
AuthenticationLevel 値のビットごとの組み合わせ既定値は MutualAuthRequested です。 相互認証では、クライアントサーバー両方が、それらの身元証明する資格情報提供します。MutualAuthRequired と MutualAuthRequested は、Kerberos 認証関連する値です。Kerberos 認証は、直接サポートすることも、Negotiate セキュリティ プロトコル使用して実際セキュリティ プロトコル選択する場合使用することもできます認証プロトコルの詳細については、「インターネット認証」を参照してください相互認証が行われたかどうかを確認するには、WebResponse.IsMutuallyAuthenticated プロパティチェックしますMutualAuthRequired 認証フラグの値を指定していて相互認証が行われない場合アプリケーションは、相互認証失敗したことを示す ProtocolViolationException 内部例外を持つ IOException を受け取ります

使用例使用例

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

// The following example uses the System, System.Net, 
// and System.IO namespaces.

public static void RequestMutualAuth(Uri
 resource)
{
    // Create a new HttpWebRequest object for the specified resource.
    WebRequest request=(WebRequest) WebRequest.Create(resource);
    // Request mutual authentication.
   request.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested;
    // Supply client credentials.
    request.Credentials = CredentialCache.DefaultCredentials;
    HttpWebResponse response = (HttpWebResponse) request.GetResponse();
    // Determine whether mutual authentication was used.
    Console.WriteLine("Is mutually authenticated? {0}", response.IsMutuallyAuthenticated);
    // Read and display the response.
    Stream streamResponse = response.GetResponseStream();
    StreamReader streamRead = new StreamReader(streamResponse);
    string responseString = streamRead.ReadToEnd();
   Console.WriteLine(responseString);
    // Close the stream objects.
    streamResponse.Close();
    streamRead.Close();
    // Release the HttpWebResponse.
    response.Close();
}
// The following example uses the System, System.Net, 
// and System.IO namespaces.
static void RequestMutualAuth( Uri^ resource
 )
{
   // Create a new HttpWebRequest object for the specified resource.
   WebRequest^ request = dynamic_cast<WebRequest^>(WebRequest::Create( resource
 ));

   // Request mutual authentication.
   request->AuthenticationLevel = AuthenticationLevel::MutualAuthRequested;

   // Supply client credentials.
   request->Credentials = CredentialCache::DefaultCredentials;
   HttpWebResponse^ response = dynamic_cast<HttpWebResponse^>(request->GetResponse());

   // Determine whether mutual authentication was used.
   Console::WriteLine( L"Is mutually authenticated? {0}", response->IsMutuallyAuthenticated
 );

   // Read and display the response.
   Stream^ streamResponse = response->GetResponseStream();
   StreamReader^ streamRead = gcnew StreamReader( streamResponse );
   String^ responseString = streamRead->ReadToEnd();
   Console::WriteLine( responseString );

   // Close the stream objects.
   streamResponse->Close();
   streamRead->Close();

   // Release the HttpWebResponse.
   response->Close();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

「WebRequest.AuthenticationLevel プロパティ」の関連用語

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

   

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



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

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

©2025 GRAS Group, Inc.RSS