Class KeycloakWebApiAuthenticationBuilderExtensions
- Namespace
- Keycloak.AuthServices.Authentication
- Assembly
- Keycloak.AuthServices.Authentication.dll
Extensions for AuthenticationBuilder for startup initialization of web APIs.
public static class KeycloakWebApiAuthenticationBuilderExtensions
- Inheritance
-
KeycloakWebApiAuthenticationBuilderExtensions
- Inherited Members
Methods
AddKeycloakWebApi(AuthenticationBuilder, IConfiguration, Action<JwtBearerOptions, IServiceProvider>?, string, string)
Protects the web API with Keycloak This method expects the configuration file will have a section, named "Keycloak" as default, with the necessary settings to initialize authentication options.
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfiguration configuration, Action<JwtBearerOptions, IServiceProvider>? configureJwtBearerOptions, string configSectionName = "Keycloak", string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationIConfigurationThe configuration instance.
configureJwtBearerOptionsAction<JwtBearerOptions, IServiceProvider>configSectionNamestringThe configuration section with the necessary settings to initialize authentication options.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, IConfiguration, Action<JwtBearerOptions>?, string, string)
Protects the web API with Keycloak This method expects the configuration file will have a section, named "Keycloak" as default, with the necessary settings to initialize authentication options.
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfiguration configuration, Action<JwtBearerOptions>? configureJwtBearerOptions, string configSectionName = "Keycloak", string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationIConfigurationThe configuration instance.
configureJwtBearerOptionsAction<JwtBearerOptions>configSectionNamestringThe configuration section with the necessary settings to initialize authentication options.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, IConfiguration, string, string)
Protects the web API with Keycloak This method expects the configuration file will have a section, named "Keycloak" as default, with the necessary settings to initialize authentication options.
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfiguration configuration, string configSectionName = "Keycloak", string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationIConfigurationThe configuration instance.
configSectionNamestringThe configuration section with the necessary settings to initialize authentication options.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, IConfigurationSection, Action<JwtBearerOptions, IServiceProvider>?, string)
Protects the web API with Keycloak
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfigurationSection configurationSection, Action<JwtBearerOptions, IServiceProvider>? configureJwtBearerOptions, string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSectionIConfigurationSectionThe configuration second from which to fill-in the options.
configureJwtBearerOptionsAction<JwtBearerOptions, IServiceProvider>jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, IConfigurationSection, Action<JwtBearerOptions>?, string)
Protects the web API with Keycloak
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfigurationSection configurationSection, Action<JwtBearerOptions>? configureJwtBearerOptions, string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSectionIConfigurationSectionThe configuration second from which to fill-in the options.
configureJwtBearerOptionsAction<JwtBearerOptions>jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, IConfigurationSection, string)
Protects the web API with Keycloak
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, IConfigurationSection configurationSection, string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSectionIConfigurationSectionThe configuration second from which to fill-in the options.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, Action<KeycloakAuthenticationOptions, IServiceProvider>, Action<JwtBearerOptions, IServiceProvider>?, string)
Protects the web API with Keycloak
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, Action<KeycloakAuthenticationOptions, IServiceProvider> configureKeycloakOptions, Action<JwtBearerOptions, IServiceProvider>? configureJwtBearerOptions = null, string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureKeycloakOptionsAction<KeycloakAuthenticationOptions, IServiceProvider>The action to configure the KeycloakAuthenticationOptions.
configureJwtBearerOptionsAction<JwtBearerOptions, IServiceProvider>The action to configure JwtBearerOptions.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.
AddKeycloakWebApi(AuthenticationBuilder, Action<KeycloakAuthenticationOptions>, Action<JwtBearerOptions>?, string)
Protects the web API with Keycloak
public static KeycloakWebApiAuthenticationBuilder AddKeycloakWebApi(this AuthenticationBuilder builder, Action<KeycloakAuthenticationOptions> configureKeycloakOptions, Action<JwtBearerOptions>? configureJwtBearerOptions = null, string jwtBearerScheme = "Bearer")
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureKeycloakOptionsAction<KeycloakAuthenticationOptions>The action to configure the KeycloakAuthenticationOptions.
configureJwtBearerOptionsAction<JwtBearerOptions>The action to configure JwtBearerOptions.
jwtBearerSchemestringThe JWT bearer scheme name to be used. By default it uses "Bearer".
Returns
- KeycloakWebApiAuthenticationBuilder
The authentication builder to chain.