AuthenticationServiceCollectionExtensions.AddAuthentication Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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. |
AddAuthentication(IServiceCollection)
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
- services
- IServiceCollection
The IServiceCollection.
Returns
A AuthenticationBuilder that can be used to further configure authentication.
Applies to
AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)
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
- services
- IServiceCollection
The IServiceCollection.
- 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
- services
- IServiceCollection
- configureOptions
- Action<SharedAuthenticationOptions>
Returns
Applies to
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.
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
- services
- IServiceCollection
The IServiceCollection.
- defaultScheme
- String
The default scheme used as a fallback for all other schemes.
Returns
A AuthenticationBuilder that can be used to further configure authentication.