Table of Contents

Class AuthorizedHttpMessageHandler

Namespace
Tenduke.Core.Auth
Assembly
Tenduke.Core.dll

A DelegatingHandler that adds an Authorization header using a pre-defined scheme and a value provided by subclass inheriting from this class.

public abstract class AuthorizedHttpMessageHandler : DelegatingHandler, IDisposable
Inheritance
AuthorizedHttpMessageHandler
Implements
Derived
Inherited Members

Constructors

AuthorizedHttpMessageHandler(string)

Initializes a new instance of the class.

protected AuthorizedHttpMessageHandler(string authorizationScheme)

Parameters

authorizationScheme string

The authorization scheme name.

Methods

GetAuthorizationValueAsync()

The value for the authorization header.

protected abstract Task<string> GetAuthorizationValueAsync()

Returns

Task<string>

SendAsync(HttpRequestMessage, CancellationToken)

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

The request was null.