Table of Contents

Class ConfigurationExtensions

Namespace
Keycloak.AuthServices.Common
Assembly
Keycloak.AuthServices.Common.dll
public static class ConfigurationExtensions
Inheritance
ConfigurationExtensions
Inherited Members

Methods

BindKeycloakOptions<T>(IConfiguration, T, string)

Binds the Keycloak options from the configuration section with the specified name to the provided options instance.

public static void BindKeycloakOptions<T>(this IConfiguration configuration, T options, string configSectionName = "Keycloak") where T : KeycloakInstallationOptions

Parameters

configuration IConfiguration

The configuration instance.

options T

The options instance to bind the configuration to.

configSectionName string

The name of the configuration section. Default is ConfigurationConstants.ConfigurationPrefix.

Type Parameters

T

The type of the Keycloak options.

BindKeycloakOptions<T>(IConfigurationSection, T)

Binds the Keycloak options from the configuration section to the provided options instance.

public static void BindKeycloakOptions<T>(this IConfigurationSection configurationSection, T options) where T : KeycloakInstallationOptions

Parameters

configurationSection IConfigurationSection
options T

The options instance to bind the configuration to.

Type Parameters

T

The type of the Keycloak options.

GetKeycloakOptions<T>(IConfiguration, string)

Retrieves the Keycloak options from the configuration section with the specified name.

public static T? GetKeycloakOptions<T>(this IConfiguration configuration, string configSectionName = "Keycloak") where T : KeycloakInstallationOptions

Parameters

configuration IConfiguration

The configuration instance.

configSectionName string

The name of the configuration section. Default is ConfigurationConstants.ConfigurationPrefix.

Returns

T

The Keycloak options instance.

Type Parameters

T

The type of the Keycloak options.

GetKeycloakOptions<T>(IConfigurationSection)

Retrieves the Keycloak options from the configuration section

public static T? GetKeycloakOptions<T>(this IConfigurationSection configurationSection) where T : KeycloakInstallationOptions

Parameters

configurationSection IConfigurationSection

Returns

T

The Keycloak options instance.

Type Parameters

T

The type of the Keycloak options.