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
builder
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configuration
IConfigurationThe configuration instance.
configSectionName
stringThe configuration section with the necessary settings to initialize authentication options.
openIdConnectScheme
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayName
stringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The KeycloakWebAppAuthenticationBuilder 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
builder
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configurationSection
IConfigurationSectionThe configuration section from which to get the options.
configureCookieAuthenticationOptions
Action<CookieAuthenticationOptions>configureOpenIdConnectOptions
Action<OpenIdConnectOptions>openIdConnectScheme
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayName
stringA 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
builder
AuthenticationBuilderThe AuthenticationBuilder to which to add this configuration.
configureKeycloakOptions
Action<KeycloakAuthenticationOptions>The action to configure KeycloakAuthenticationOptions.
configureCookieAuthenticationOptions
Action<CookieAuthenticationOptions>The action to configure CookieAuthenticationOptions.
configureOpenIdConnectOptions
Action<OpenIdConnectOptions>openIdConnectScheme
stringThe OpenID Connect scheme name to be used. By default it uses "OpenIdConnect".
cookieScheme
stringThe cookie-based scheme name to be used. By default it uses "Cookies".
displayName
stringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder for chaining.