MVC Core How to force / set global authorization for all actions?
<p><strong>How to force / set global authorization for all actions in MVC Core ?</strong></p>

<p>I know how to register global filters - for example I have:</p>

<pre><code>Setup.cs

services.AddMvc(options =&gt;
{
    options.Filters.Add(new RequireHttpsAttribute());
});
</code></pre>

<p>and this works fine, but I can't add the same for Authorize:</p>

<p><code>options.Filters.Add(new AuthorizeAttribute());</code></p>

<p>I have error:</p>

<p><code>Cannot convert from 'Microsoft.AspNet.Authorization.AuthorizeAttribute()' to 'System.Type'</code></p>

<p><em>(Method <code>.Add()</code> needs <code>IFilterMetadata</code> type)</em></p>

<p><br>I know - from similar questions - that this works on MVC4-5... So something must changed on MVC Core...</p>

<p><strong>Someone have any idea?</strong></p>