AuthenticationManager.PreAuthenticate(WebRequest, ICredentials) メソッド

定義

注意事項

The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.

要求の事前認証を行います。

public:
 static System::Net::Authorization ^ PreAuthenticate(System::Net::WebRequest ^ request, System::Net::ICredentials ^ credentials);
[System.Obsolete("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0009", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.Authorization? PreAuthenticate (System.Net.WebRequest request, System.Net.ICredentials credentials);
public static System.Net.Authorization? PreAuthenticate (System.Net.WebRequest request, System.Net.ICredentials credentials);
public static System.Net.Authorization PreAuthenticate (System.Net.WebRequest request, System.Net.ICredentials credentials);
[<System.Obsolete("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0009", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
static member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
static member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
Public Shared Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization

パラメーター

request
WebRequest

インターネット リソースへの要求。

credentials
ICredentials

要求に関連付けられている資格情報。

戻り値

要求を事前認証できる場合は Authorization クラスのインスタンス、それ以外の場合は null です。 credentialsnull の場合、このメソッドは null を返します。

属性

例外

.NET Core および .NET 5 以降のみ:すべての場合。

requestnullです。

注釈

認証モジュールが要求を事前認証できる場合、メソッドは認証インスタンスを返し、 PreAuthenticate リソースがチャレンジを発行するのを待つのではなく、事前に承認情報をサーバーに送信します。 この動作の概要は、RFC 2617 のセクション 3.3 (HTTP 認証: 基本およびダイジェスト アクセス認証) にあります。 事前認証をサポートする認証モジュールを使用すると、クライアントは認証の課題によって引き起こされる余分なラウンド トリップを回避することで、サーバーの効率を向上させることができます。

要求を事前認証できる承認モジュールでは、 プロパティを IAuthenticationModule.CanPreAuthenticatetrue設定します。

適用対象