Class KeycloakWebAppAuthenticationBuilderExtensions
- Namespace
- Keycloak.AuthServices.Authentication
- Assembly
- Keycloak.AuthServices.Authentication.dll
Extensions for the AuthenticationBuilder for startup initialization.
public static class KeycloakWebAppAuthenticationBuilderExtensions
- Inheritance
-
KeycloakWebAppAuthenticationBuilderExtensions
- Inherited Members
Methods
AddKeycloakWebApp(AuthenticationBuilder, IConfiguration, string, string, string, string?)
Add authentication to a web app 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 KeycloakWebAppAuthenticationBuilder AddKeycloakWebApp(this AuthenticationBuilder builder, IConfiguration configuration, string configSectionName = "Keycloak", string openIdConnectScheme = "OpenIdConnect", string cookieScheme = "Cookies", string? displayName = null)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationIConfigurationThe configuration instance.
configSectionNamestringThe configuration section with the necessary settings to initialize authentication options.
openIdConnectSchemestringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieSchemestringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayNamestringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The KeycloakWebAppAuthenticationBuilder builder for chaining.
AddKeycloakWebApp(AuthenticationBuilder, IConfigurationSection, Action<CookieAuthenticationOptions, IServiceProvider>?, Action<OpenIdConnectOptions, IServiceProvider>?, string, string?, string?)
Add authentication with Keycloak This method expects the configuration file will have a section, named "AzureAd" as default, with the necessary settings to initialize authentication options.
public static KeycloakWebAppAuthenticationBuilder AddKeycloakWebApp(this AuthenticationBuilder builder, IConfigurationSection configurationSection, Action<CookieAuthenticationOptions, IServiceProvider>? configureCookieAuthenticationOptions = null, Action<OpenIdConnectOptions, IServiceProvider>? configureOpenIdConnectOptions = null, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", string? displayName = null)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSectionIConfigurationSectionThe configuration section from which to get the options.
configureCookieAuthenticationOptionsAction<CookieAuthenticationOptions, IServiceProvider>configureOpenIdConnectOptionsAction<OpenIdConnectOptions, IServiceProvider>openIdConnectSchemestringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieSchemestringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayNamestringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder for chaining.
AddKeycloakWebApp(AuthenticationBuilder, IConfigurationSection, Action<CookieAuthenticationOptions>?, Action<OpenIdConnectOptions>?, string, string?, string?)
Add authentication with Keycloak This method expects the configuration file will have a section, named "AzureAd" as default, with the necessary settings to initialize authentication options.
public static KeycloakWebAppAuthenticationBuilder AddKeycloakWebApp(this AuthenticationBuilder builder, IConfigurationSection configurationSection, Action<CookieAuthenticationOptions>? configureCookieAuthenticationOptions = null, Action<OpenIdConnectOptions>? configureOpenIdConnectOptions = null, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", string? displayName = null)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSectionIConfigurationSectionThe configuration section from which to get the options.
configureCookieAuthenticationOptionsAction<CookieAuthenticationOptions>configureOpenIdConnectOptionsAction<OpenIdConnectOptions>openIdConnectSchemestringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieSchemestringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayNamestringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder for chaining.
AddKeycloakWebApp(AuthenticationBuilder, Action<KeycloakAuthenticationOptions, IServiceProvider>, Action<CookieAuthenticationOptions, IServiceProvider>?, Action<OpenIdConnectOptions, IServiceProvider>?, string, string?, string?)
Add authentication with Keycloak
public static KeycloakWebAppAuthenticationBuilder AddKeycloakWebApp(this AuthenticationBuilder builder, Action<KeycloakAuthenticationOptions, IServiceProvider> configureKeycloakOptions, Action<CookieAuthenticationOptions, IServiceProvider>? configureCookieAuthenticationOptions = null, Action<OpenIdConnectOptions, IServiceProvider>? configureOpenIdConnectOptions = null, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", string? displayName = null)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureKeycloakOptionsAction<KeycloakAuthenticationOptions, IServiceProvider>The action to configure KeycloakAuthenticationOptions.
configureCookieAuthenticationOptionsAction<CookieAuthenticationOptions, IServiceProvider>The action to configure CookieAuthenticationOptions.
configureOpenIdConnectOptionsAction<OpenIdConnectOptions, IServiceProvider>openIdConnectSchemestringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieSchemestringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayNamestringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder for chaining.
AddKeycloakWebApp(AuthenticationBuilder, Action<KeycloakAuthenticationOptions>, Action<CookieAuthenticationOptions>?, Action<OpenIdConnectOptions>?, string, string?, string?)
Add authentication with Keycloak
public static KeycloakWebAppAuthenticationBuilder AddKeycloakWebApp(this AuthenticationBuilder builder, Action<KeycloakAuthenticationOptions> configureKeycloakOptions, Action<CookieAuthenticationOptions>? configureCookieAuthenticationOptions = null, Action<OpenIdConnectOptions>? configureOpenIdConnectOptions = null, string openIdConnectScheme = "OpenIdConnect", string? cookieScheme = "Cookies", string? displayName = null)
Parameters
builderAuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureKeycloakOptionsAction<KeycloakAuthenticationOptions>The action to configure KeycloakAuthenticationOptions.
configureCookieAuthenticationOptionsAction<CookieAuthenticationOptions>The action to configure CookieAuthenticationOptions.
configureOpenIdConnectOptionsAction<OpenIdConnectOptions>openIdConnectSchemestringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieSchemestringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayNamestringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder for chaining.