Table of Contents

Class ServiceCollectionExtensions

Namespace
Keycloak.AuthServices.Authentication
Assembly
Keycloak.AuthServices.Authentication.dll

Configures Authentication via Keycloak

[Obsolete("This class will be removed")]
public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

AddKeycloakAuthentication(IServiceCollection, KeycloakAuthenticationOptions, Action<JwtBearerOptions>?)

Adds keycloak authentication services.

[Obsolete("This method will be removed. Use AddKeycloakWebApiAuthentication. Furthermore, the way KeycloakAuthenticationOptions is changed and you need to specify KeycloakFormatBinder.Instance to correctly bind the instance. See for more details https://nikiforovall.github.io/keycloak-authorization-services-dotnet/migration.html#key-changes-in-2-0-0")]
public static AuthenticationBuilder AddKeycloakAuthentication(this IServiceCollection services, KeycloakAuthenticationOptions keycloakOptions, Action<JwtBearerOptions>? configureOptions = null)

Parameters

services IServiceCollection
keycloakOptions KeycloakAuthenticationOptions
configureOptions Action<JwtBearerOptions>

Returns

AuthenticationBuilder

AddKeycloakAuthentication(IServiceCollection, IConfiguration, Action<JwtBearerOptions>?)

Adds keycloak authentication services from configuration located in specified default section.

[Obsolete("This method will be removed. Use AddKeycloakWebApiAuthentication")]
public static AuthenticationBuilder AddKeycloakAuthentication(this IServiceCollection services, IConfiguration configuration, Action<JwtBearerOptions>? configureOptions = null)

Parameters

services IServiceCollection

Source service collection

configuration IConfiguration

Configuration source

configureOptions Action<JwtBearerOptions>

Configure overrides

Returns

AuthenticationBuilder

AddKeycloakAuthentication(IServiceCollection, IConfiguration, string, Action<JwtBearerOptions>?)

Adds keycloak authentication services from section

[Obsolete("This method will be removed. Use AddKeycloakWebApiAuthentication")]
public static AuthenticationBuilder AddKeycloakAuthentication(this IServiceCollection services, IConfiguration configuration, string keycloakClientSectionName, Action<JwtBearerOptions>? configureOptions = null)

Parameters

services IServiceCollection
configuration IConfiguration
keycloakClientSectionName string
configureOptions Action<JwtBearerOptions>

Returns

AuthenticationBuilder