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 的引用。

适用于