AuthenticationServiceCollectionExtensions.AddAuthentication Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
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. |
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
- services
- IServiceCollection
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
- services
- IServiceCollection
- 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
- services
- IServiceCollection
- configureOptions
- Action<SharedAuthenticationOptions>
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
- services
- IServiceCollection
- defaultScheme
- String
Skema default yang digunakan sebagai fallback untuk semua skema lainnya.
Mengembalikan
Yang AuthenticationBuilder dapat digunakan untuk mengonfigurasi autentikasi lebih lanjut.
Berlaku untuk
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk