AuthorizationEndpointConventionBuilderExtensions.AllowAnonymous<TBuilder> Method

Definition

Allows anonymous access to the endpoint by adding AllowAnonymousAttribute to the endpoint metadata. This will bypass all authorization checks for the endpoint including the default authorization policy and fallback authorization policy.

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

Type Parameters

TBuilder

Parameters

builder
TBuilder

The endpoint convention builder.

Returns

TBuilder

The original convention builder parameter.

Applies to