AuthenticationServiceCollectionExtensions.AddAuthentication Metode

Definisi

Overload

AddAuthentication(IServiceCollection)

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi.

AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi dan mengonfigurasi AuthenticationOptions.

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

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi. defaultScheme menentukan nama skema yang akan digunakan secara default saat skema tertentu tidak diminta.

AddAuthentication(IServiceCollection)

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi.

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

Parameter

Mengembalikan

Yang AuthenticationBuilder dapat digunakan untuk mengonfigurasi autentikasi lebih lanjut.

Berlaku untuk

AddAuthentication(IServiceCollection, Action<AuthenticationOptions>)

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi dan mengonfigurasi 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

Parameter

configureOptions
Action<AuthenticationOptions>

Delegasi untuk mengonfigurasi AuthenticationOptions.

Mengembalikan

Yang AuthenticationBuilder dapat digunakan untuk mengonfigurasi autentikasi lebih lanjut.

Berlaku untuk

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

Parameter

Mengembalikan

Berlaku untuk

AddAuthentication(IServiceCollection, String)

Mendaftarkan layanan yang diperlukan oleh layanan autentikasi. defaultScheme menentukan nama skema yang akan digunakan secara default saat skema tertentu tidak diminta.

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

Parameter

defaultScheme
String

Skema default yang digunakan sebagai fallback untuk semua skema lainnya.

Mengembalikan

Yang AuthenticationBuilder dapat digunakan untuk mengonfigurasi autentikasi lebih lanjut.

Berlaku untuk