Table of Contents

Class OAuthHandler

Namespace
TypedRest.OAuth
Assembly
TypedRest.OAuth.dll

HTTP message delegating handler that transparently performs OAuth 2.0 authentication with a client secret. Performs OpenID Connect discovery to find the token endpoint.

public class OAuthHandler : DelegatingHandler, IDisposable
Inheritance
OAuthHandler
Implements
Inherited Members

Constructors

OAuthHandler(OAuthOptions, HttpMessageHandler?)

Creates a new OAuth handler.

public OAuthHandler(OAuthOptions oAuthOptions, HttpMessageHandler? innerHandler = null)

Parameters

oAuthOptions OAuthOptions

Options for OAuth 2.0 / OpenID Connect authentication.

innerHandler HttpMessageHandler

An optional inner HTTP message handler to delegate to.

Methods

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.