AuthorizationAppBuilderExtensions.UseAuthorization 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
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
参数
要 IApplicationBuilder 向其添加中间件的 。
返回
操作完成后对 app
的引用。