Table of Contents

Class ServiceCollectionExtensions

Namespace
Keycloak.AuthServices.Sdk
Assembly
Keycloak.AuthServices.Sdk.dll

Adds HTTP Client SDKs

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddKeycloakAdminHttpClient(IServiceCollection, KeycloakAdminClientOptions, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, KeycloakAdminClientOptions keycloakOptions, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

keycloakOptions KeycloakAdminClientOptions

The Keycloak client options.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakAdminHttpClient(IServiceCollection, IConfiguration, Action<HttpClient>?, string)

public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, IConfiguration configuration, Action<HttpClient>? configureClient = null, string keycloakClientSectionName = "Keycloak")

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configuration IConfiguration

The IConfiguration instance to bind the Keycloak options from.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

keycloakClientSectionName string

The name of the configuration section containing the Keycloak client options.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakAdminHttpClient(IServiceCollection, IConfigurationSection, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, IConfigurationSection configurationSection, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configurationSection IConfigurationSection

The IConfigurationSection to bind the Keycloak options from.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakAdminHttpClient(IServiceCollection, Action<KeycloakAdminClientOptions>, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, Action<KeycloakAdminClientOptions> configureKeycloakOptions, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configureKeycloakOptions Action<KeycloakAdminClientOptions>

An action to configure the Keycloak client options.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakProtectionHttpClient(IServiceCollection, KeycloakProtectionClientOptions, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, KeycloakProtectionClientOptions keycloakOptions, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

keycloakOptions KeycloakProtectionClientOptions

The Keycloak client options.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakProtectionHttpClient(IServiceCollection, IConfiguration, Action<HttpClient>?, string)

public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, IConfiguration configuration, Action<HttpClient>? configureClient = null, string keycloakClientSectionName = "Keycloak")

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configuration IConfiguration

The IConfiguration instance to bind the Keycloak options from.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

keycloakClientSectionName string

The name of the configuration section containing the Keycloak client options.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakProtectionHttpClient(IServiceCollection, IConfigurationSection, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, IConfigurationSection configurationSection, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configurationSection IConfigurationSection

The IConfigurationSection to bind the Keycloak options from.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.

AddKeycloakProtectionHttpClient(IServiceCollection, Action<KeycloakProtectionClientOptions>, Action<HttpClient>?)

public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, Action<KeycloakProtectionClientOptions> configureKeycloakOptions, Action<HttpClient>? configureClient = null)

Parameters

services IServiceCollection

The IServiceCollection to add the HttpClient to.

configureKeycloakOptions Action<KeycloakProtectionClientOptions>

An action to configure the Keycloak client options.

configureClient Action<HttpClient>

An optional action to configure the HttpClient.

Returns

IHttpClientBuilder

The IHttpClientBuilder for further configuration.