Language

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);
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);
static member PreAuthenticate : System.Net.WebRequest * System.Net.ICredentials -> System.Net.Authorization
[<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
Public Shared Function PreAuthenticate (request As WebRequest, credentials As ICredentials) As Authorization

パラメーター

request
WebRequest

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

credentials
ICredentials

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

返品

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

属性

例外

.NET Core と .NET 5 以降のみ: すべての場合。

request は nullです。

注釈

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

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

適用対象