title: .NET MVC Swashbuckle gated by Basic Auth
body: <p>Is there a way to gate SwashBuckle documentation page behind a Basic Auth attribute? So only those with the right username and password can see the documentation page.</p>
  
  <p>The swashbuckle is configured with </p>
  
  <pre><code>GlobalConfiguration.Configuration.EnableSwagger
  </code></pre>
  
  <p>and </p>
  
  <pre><code>.EnableSwaggerUi
  </code></pre>
  
  <p>but it creates its own MessageHandler so there is no where for me to attach my Basic Auth attribute which is implemented as a <code>ActionFilterAttribute</code>.</p>
  
  <p>I also do not want the basic auth to be applied to the entire site, just the swagger endpoints</p>