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입니다. credentials이(가) null이면 이 메서드는 null을(를) 반환합니다.

특성

예외

.NET Core 및 .NET 5+ 전용: 모든 경우

requestnull입니다.

설명

인증 모듈이 요청을 미리 인증할 수 있는 경우 메서드는 PreAuthenticate 인증 instance 반환하고 리소스가 챌린지를 실행할 때까지 기다리지 않고 인증 정보를 선제적으로 서버에 보냅니다. 이 동작은 RFC 2617의 섹션 3.3(HTTP 인증: 기본 및 다이제스트 액세스 인증)에 설명되어 있습니다. 사전 인증을 지원하는 인증 모듈을 사용하면 클라이언트가 인증 문제로 인한 추가 왕복을 방지하여 서버 효율성을 향상시킬 수 있습니다.

요청을 미리 인증할 수 있는 권한 부여 모듈은 속성을 trueIAuthenticationModule.CanPreAuthenticate 설정합니다.

적용 대상