title: How do I automatically authorize all endpoints with Swagger UI?
body: <p>I have an entire API deployed and accessible with Swagger UI. It uses Basic Auth over HTTPS, and one can easily hit the Authorize button and enter credentials and things work great with the nice Try it out! feature.</p>
  
  <p>However, I would like to make a public sandboxed version of the API with a shared username and password, that is always authenticated; that is, no one should ever have to bring up the authorization dialog to enter credentials.</p>
  
  <p>I tried to enter an authorization based on the answer from another Stack Overflow question by putting the following code inside a <code>script</code> element on the HTML page:</p>
  
  <pre class="lang-js prettyprint-override"><code>window.swaggerUi.load();
  swaggerUi.api.clientAuthorizations.add("key", 
    new SwaggerClient.ApiKeyAuthorization(
    "Authorization", "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", "header"));
  </code></pre>
  
  <p>However, when I hit the <code>Try it out!</code> button the authorization is not used.</p>
  
  <p>What would be the proper way to go about globally setting the auth header on all endpoints, so that no user has to enter the credentials manually?</p>
  
  <p>(I know that might sound like a weird question, but like I mention, it is a public username/password.)</p>