AuthorizationEndpointConventionBuilderExtensions.AllowAnonymous<TBuilder> 方法

定义

通过将 添加到 AllowAnonymousAttribute 终结点元数据,允许匿名访问终结点。 这将绕过终结点的所有授权检查,包括默认授权策略和回退授权策略。

public:
generic <typename TBuilder>
 where TBuilder : Microsoft::AspNetCore::Builder::IEndpointConventionBuilder[System::Runtime::CompilerServices::Extension]
 static TBuilder AllowAnonymous(TBuilder builder);
public static TBuilder AllowAnonymous<TBuilder> (this TBuilder builder) where TBuilder : Microsoft.AspNetCore.Builder.IEndpointConventionBuilder;
static member AllowAnonymous : 'Builder -> 'Builder (requires 'Builder :> Microsoft.AspNetCore.Builder.IEndpointConventionBuilder)
<Extension()>
Public Function AllowAnonymous(Of TBuilder As IEndpointConventionBuilder) (builder As TBuilder) As TBuilder

类型参数

TBuilder

参数

builder
TBuilder

终结点约定生成器。

返回

TBuilder

原始约定生成器参数。

适用于