Class KeycloakWebAppServiceCollectionExtensions
- Namespace
- Keycloak.AuthServices.Authentication
- Assembly
- Keycloak.AuthServices.Authentication.dll
Extension for IServiceCollection for startup initialization.
public static class KeycloakWebAppServiceCollectionExtensions
- Inheritance
-
KeycloakWebAppServiceCollectionExtensions
- Inherited Members
Methods
AddKeycloakWebAppAuthentication(IServiceCollection, IConfiguration, string, string, string, string?)
Add authentication with Keycloak This method expects the configuration file will have a section, (by default named "Keycloak"), with the necessary settings to initialize the authentication options.
public static KeycloakWebAppAuthenticationBuilder AddKeycloakWebAppAuthentication(this IServiceCollection services, IConfiguration configuration, string configSectionName = "Keycloak", string openIdConnectScheme = "OpenIdConnect", string cookieScheme = "Cookies", string? displayName = null)
Parameters
services
IServiceCollectionService collection to which to add authentication.
configuration
IConfigurationThe IConfiguration object.
configSectionName
stringThe name of the configuration section with the necessary settings to initialize authentication options.
openIdConnectScheme
stringOptional name for the open id connect authentication scheme (by default OpenIdConnectDefaults.AuthenticationScheme). This can be specified when you want to support several OpenIdConnect identity providers.
cookieScheme
stringOptional name for the cookie authentication scheme (by default CookieAuthenticationDefaults.AuthenticationScheme).
displayName
stringA display name for the authentication handler.
Returns
- KeycloakWebAppAuthenticationBuilder
The authentication builder to chain extension methods.