Details

Require Authenticated User

By adding the following few lines of code,
you are requiring all users of the app
to be authenticated before accessing any endpoint

Except endpoints that have the [AllowAnonymous] attribute

// Require users of the app to be authenticated
builder.Services.AddAuthorizationBuilder()
    .SetFallbackPolicy(new AuthorizationPolicyBuilder()
        .RequireAuthenticatedUser()
        .Build());