Bagikan melalui


AuthorizationAppBuilderExtensions.UseAuthorization Metode

Definisi

AuthorizationMiddleware Menambahkan ke , yang ditentukan IApplicationBuilderyang memungkinkan kemampuan otorisasi.

Saat mengotorisasi sumber daya yang dirutekan menggunakan perutean titik akhir, panggilan ini harus muncul di antara panggilan ke app.UseRouting() dan app.UseEndpoints(...) agar middleware berfungsi dengan benar.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Builder::IApplicationBuilder ^ UseAuthorization(Microsoft::AspNetCore::Builder::IApplicationBuilder ^ app);
public static Microsoft.AspNetCore.Builder.IApplicationBuilder UseAuthorization (this Microsoft.AspNetCore.Builder.IApplicationBuilder app);
static member UseAuthorization : Microsoft.AspNetCore.Builder.IApplicationBuilder -> Microsoft.AspNetCore.Builder.IApplicationBuilder
<Extension()>
Public Function UseAuthorization (app As IApplicationBuilder) As IApplicationBuilder

Parameter

app
IApplicationBuilder

untuk IApplicationBuilder menambahkan middleware.

Mengembalikan

Referensi ke app setelah operasi selesai.

Berlaku untuk