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>?)
Adds IKeycloakClient, IKeycloakRealmClient, IKeycloakUserClient, IKeycloakGroupClient HTTP clients for Keycloak Admin API.
public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, KeycloakAdminClientOptions keycloakOptions, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
keycloakOptions
KeycloakAdminClientOptionsThe 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)
Adds IKeycloakClient, IKeycloakRealmClient, IKeycloakUserClient, IKeycloakGroupClient HTTP clients for Keycloak Admin API.
public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, IConfiguration configuration, Action<HttpClient>? configureClient = null, string keycloakClientSectionName = "Keycloak")
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
configuration
IConfigurationThe IConfiguration instance to bind the Keycloak options from.
configureClient
Action<HttpClient>An optional action to configure the HttpClient.
keycloakClientSectionName
stringThe name of the configuration section containing the Keycloak client options.
Returns
- IHttpClientBuilder
The IHttpClientBuilder for further configuration.
AddKeycloakAdminHttpClient(IServiceCollection, IConfigurationSection, Action<HttpClient>?)
Adds IKeycloakClient, IKeycloakRealmClient, IKeycloakUserClient, IKeycloakGroupClient HTTP clients for Keycloak Admin API.
public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, IConfigurationSection configurationSection, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
configurationSection
IConfigurationSectionThe 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>?)
Adds IKeycloakClient, IKeycloakRealmClient, IKeycloakUserClient, IKeycloakGroupClient for Keycloak Admin API.
public static IHttpClientBuilder AddKeycloakAdminHttpClient(this IServiceCollection services, Action<KeycloakAdminClientOptions> configureKeycloakOptions, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe 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>?)
Adds IKeycloakProtectionClient, IKeycloakProtectedResourceClient, IKeycloakPolicyClient HTTP clients for Protection API.
public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, KeycloakProtectionClientOptions keycloakOptions, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
keycloakOptions
KeycloakProtectionClientOptionsThe 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)
Adds IKeycloakProtectionClient, IKeycloakProtectedResourceClient, IKeycloakPolicyClient HTTP clients for Protection API.
public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, IConfiguration configuration, Action<HttpClient>? configureClient = null, string keycloakClientSectionName = "Keycloak")
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
configuration
IConfigurationThe IConfiguration instance to bind the Keycloak options from.
configureClient
Action<HttpClient>An optional action to configure the HttpClient.
keycloakClientSectionName
stringThe name of the configuration section containing the Keycloak client options.
Returns
- IHttpClientBuilder
The IHttpClientBuilder for further configuration.
AddKeycloakProtectionHttpClient(IServiceCollection, IConfigurationSection, Action<HttpClient>?)
Adds IKeycloakProtectionClient, IKeycloakProtectedResourceClient, IKeycloakPolicyClient HTTP clients for Protection API.
public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, IConfigurationSection configurationSection, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe IServiceCollection to add the HttpClient to.
configurationSection
IConfigurationSectionThe 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>?)
Adds IKeycloakProtectionClient, IKeycloakProtectedResourceClient, IKeycloakPolicyClient HTTP clients for Protection API.
public static IHttpClientBuilder AddKeycloakProtectionHttpClient(this IServiceCollection services, Action<KeycloakProtectionClientOptions> configureKeycloakOptions, Action<HttpClient>? configureClient = null)
Parameters
services
IServiceCollectionThe 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.