閱讀英文

共用方式為


AuthorizationAppBuilderExtensions.UseAuthorization 方法

定義

AuthorizationMiddleware 加入至指定的 IApplicationBuilder ,以啟用授權功能。

授權使用端點路由路由路由傳送的資源時,此呼叫必須出現在 呼叫 app.UseRouting()app.UseEndpoints(...) 之間,中介軟體才能正常運作。

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

參數

app
IApplicationBuilder

IApplicationBuilder 加入中介軟體的 。

傳回

作業完成之後的 app 參考。

適用於

產品 版本
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0