C# 클래스 WebApiDoodle.Web.MessageHandlers.BasicAuthenticationHandler

HTTP Basic Authentication abstraction message handler
상속: System.Net.Http.DelegatingHandler
파일 보기 프로젝트 열기: tugberkugurlu/WebAPIDoodle

공개 메소드들

메소드 설명
BasicAuthenticationHandler ( ) : System

Parameterless constructor. Sets the SuppressIfAlreadyAuthenticated to false.

BasicAuthenticationHandler ( bool suppressIfAlreadyAuthenticated ) : System

Constructor to supply the SuppressIfAlreadyAuthenticated value.

보호된 메소드들

메소드 설명
AuthenticateUserAsync ( HttpRequestMessage request, string username, string password, CancellationToken cancellationToken ) : Task

The method which is responsable for authenticating the user based on the provided credentials.

HandleUnauthenticatedRequest ( UnauthenticatedRequestContext context ) : void

Called when the request is unauthenticated.

SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task

비공개 메소드들

메소드 설명
EnsureRequestMessageExistence ( HttpResponseMessage response, HttpRequestMessage request ) : void
HandleUnauthenticatedRequestImpl ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
TryExtractBasicAuthCredentialsFromHeader ( string authorizationHeader, string &username, string &password ) : bool

메소드 상세

AuthenticateUserAsync() 보호된 추상적인 메소드

The method which is responsable for authenticating the user based on the provided credentials.
protected abstract AuthenticateUserAsync ( HttpRequestMessage request, string username, string password, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
username string The username value extracted from BasicAuth header.
password string The password value extracted from BasicAuth header.
cancellationToken System.Threading.CancellationToken A cancellation token to cancel operation.
리턴 Task

BasicAuthenticationHandler() 공개 메소드

Parameterless constructor. Sets the SuppressIfAlreadyAuthenticated to false.
public BasicAuthenticationHandler ( ) : System
리턴 System

BasicAuthenticationHandler() 공개 메소드

Constructor to supply the SuppressIfAlreadyAuthenticated value.
public BasicAuthenticationHandler ( bool suppressIfAlreadyAuthenticated ) : System
suppressIfAlreadyAuthenticated bool Indicates whether the authentication should be suppressed if the request is already authenticated.
리턴 System

HandleUnauthenticatedRequest() 보호된 메소드

Called when the request is unauthenticated.
protected HandleUnauthenticatedRequest ( UnauthenticatedRequestContext context ) : void
context UnauthenticatedRequestContext Context object which carries the HTTP request message to send to the server and the empty HTTP response property.
리턴 void

SendAsync() 보호된 메소드

protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage
cancellationToken System.Threading.CancellationToken
리턴 Task