AuthenticationServiceCollectionExtensions.AddAuthentication Method

Definition

Overloads

AddAuthentication(IServiceCollection)

Registers services required by authentication services.

AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)

Registers services required by authentication services and configures AuthenticationOptions.

AddAuthentication(IServiceCollection, Action<SharedAuthenticationOptions>)
AddAuthentication(IServiceCollection, String)

Registers services required by authentication services. defaultScheme specifies the name of the scheme to use by default when a specific scheme isn't requested.

AddAuthentication(IServiceCollection)

Source:
AuthenticationServiceCollectionExtensions.cs
Source:
AuthenticationServiceCollectionExtensions.cs

Registers services required by authentication services.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection) As IServiceCollection
<Extension()>
Public Function AddAuthentication (services As IServiceCollection) As AuthenticationBuilder

Parameters

Returns

A AuthenticationBuilder that can be used to further configure authentication.

Applies to

AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)

Source:
AuthenticationServiceCollectionExtensions.cs
Source:
AuthenticationServiceCollectionExtensions.cs

Registers services required by authentication services and configures AuthenticationOptions.

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Authentication.AuthenticationOptions> configureOptions);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Authentication.AuthenticationOptions> -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, configureOptions As Action(Of AuthenticationOptions)) As AuthenticationBuilder

Parameters

configureOptions
Action<AuthenticationOptions>

A delegate to configure AuthenticationOptions.

Returns

A AuthenticationBuilder that can be used to further configure authentication.

Applies to

AddAuthentication(IServiceCollection, Action<SharedAuthenticationOptions>)

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions> configureOptions);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.Authentication.SharedAuthenticationOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, configureOptions As Action(Of SharedAuthenticationOptions)) As IServiceCollection

Parameters

Returns

Applies to

AddAuthentication(IServiceCollection, String)

Source:
AuthenticationServiceCollectionExtensions.cs
Source:
AuthenticationServiceCollectionExtensions.cs

Registers services required by authentication services. defaultScheme specifies the name of the scheme to use by default when a specific scheme isn't requested.

public static Microsoft.AspNetCore.Authentication.AuthenticationBuilder AddAuthentication (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string defaultScheme);
static member AddAuthentication : Microsoft.Extensions.DependencyInjection.IServiceCollection * string -> Microsoft.AspNetCore.Authentication.AuthenticationBuilder
<Extension()>
Public Function AddAuthentication (services As IServiceCollection, defaultScheme As String) As AuthenticationBuilder

Parameters

defaultScheme
String

The default scheme used as a fallback for all other schemes.

Returns

A AuthenticationBuilder that can be used to further configure authentication.

Applies to