Table of Contents

Class HttpClientBuilderExtensions

Namespace
TypedRest.OAuth
Assembly
TypedRest.OAuth.dll

Provides extension methods for IHttpClientBuilder.

public static class HttpClientBuilderExtensions
Inheritance
HttpClientBuilderExtensions
Inherited Members

Methods

AddOAuthHandler(IHttpClientBuilder, Action<OAuthOptions>)

Adds an HTTP message delegating handler that transparently performs OAuth 2.0 authentication with a client secret.

public static IHttpClientBuilder AddOAuthHandler(this IHttpClientBuilder builder, Action<OAuthOptions> configureOptions)

Parameters

builder IHttpClientBuilder

The builder to apply the configuration to.

configureOptions Action<OAuthOptions>

A delegate that is used to configure OAuthOptions.

Returns

IHttpClientBuilder

AddOAuthHandler(IHttpClientBuilder, Func<IServiceProvider, OAuthOptions>)

Adds an HTTP message delegating handler that transparently performs OAuth 2.0 authentication with a client secret.

public static IHttpClientBuilder AddOAuthHandler(this IHttpClientBuilder builder, Func<IServiceProvider, OAuthOptions> configureOptions)

Parameters

builder IHttpClientBuilder

The builder to apply the configuration to.

configureOptions Func<IServiceProvider, OAuthOptions>

A delegate that is used to provide OAuthOptions.

Returns

IHttpClientBuilder

AddOAuthHandler(IHttpClientBuilder, Uri, string, string)

Adds an HTTP message delegating handler that transparently performs OAuth 2.0 authentication with a client secret.

public static IHttpClientBuilder AddOAuthHandler(this IHttpClientBuilder builder, Uri uri, string clientId, string clientSecret)

Parameters

builder IHttpClientBuilder

The builder to apply the configuration to.

uri Uri

The URI of the identity server to request an authentication token from.

clientId string

The client identifier to present to the identity server.

clientSecret string

The client secret to present to the identity server.

Returns

IHttpClientBuilder