title: AuthorizationFilter throws exception
body: <p>Trying to register an <code>AuthorizationFilter</code> against my controllers. I have previously set one up but that is an <code>IActionFilter</code> but when doing the same thing with an <code>AuthorizationFilter</code> instead it throws this exception:</p>
  <pre><code>System.InvalidOperationException: No authenticationScheme was specified, and there was no DefaultChallengeScheme found. The default schemes can be set using either AddAuthentication(string defaultScheme) or AddAuthentication(Action&lt;AuthenticationOptions&gt; configureOptions).
  </code></pre>
  <p>My code looks like this:
  <strong>Program.cs</strong></p>
  <pre><code>builder.Services.AddControllers(options =&gt; {
      options.Filters.Add&lt;SecureByDefaultFilter&gt;();
      options.Filters.Add&lt;AuthorisedFilter&gt;();
  });
  </code></pre>
  <p><strong>AuthorizationFilter that doesn't work</strong></p>
  <pre><code>internal class AuthorisedFilter : IAuthorizationFilter {
          public void OnAuthorization(AuthorizationFilterContext context) {
              var authorizedAttribute = context.ActionDescriptor.EndpointMetadata.OfType&lt;AuthorisedAttribute&gt;().FirstOrDefault();
  
              if (authorizedAttribute?.Roles == &quot;Public&quot;) {
                  return;
              }
  
              Console.WriteLine(authorizedAttribute?.Roles);
          }
      }
  </code></pre>
  <p><strong>Action filter that works</strong></p>
  <pre><code>internal class SecureByDefaultFilter : IActionFilter {
          public void OnActionExecuting(ActionExecutingContext context) {
              var authorizedAttribute = context.ActionDescriptor.EndpointMetadata.OfType&lt;AuthorisedAttribute&gt;().FirstOrDefault();
              
              if (authorizedAttribute == null) {
                  throw new MissingAttributeException(&quot;Endpoint missing Authorised Attribute&quot;);
              }      
          }
  
          public void OnActionExecuted(ActionExecutedContext context) { }
      }
  </code></pre>