title: Use the [Authorize]-attribute on Swagger UI with ASP.NET Core Swashbuckle
body: <p>In ASP.NET Core, using <a href="https://www.nuget.org/packages/Swashbuckle.AspNetCore" rel="noreferrer"><code>Swashbuckle.AspNetCore</code></a>, how do I protect the access to my Swagger UI in the same way as decorating it with the <code>[Authorize]</code>-attribute?</p>
  
  <p>I want the (equivalent of) <code>[Authorize]</code>-attribute to execute, like for a normally decorated controller/action, when someone tries to access the <code>/swagger</code>-URL on my web-app, <strong>so that my custom <code>AuthenticationHandler&lt;T&gt;</code> is executed</strong>.</p>