title: How to add authorization (Authorize button) in swagger for ocelot
body: <p>How can I add Authorize button in swagger, when I have ocelot api gateway?</p>
  <p><a href="https://i.stack.imgur.com/Pnxsn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pnxsn.png" alt="enter image description here" /></a></p>
  <p>I configure my service collection like that:</p>
  <pre><code>s.AddSwaggerForOcelot(configuration);
  
  s.AddSwaggerGen(c =&gt;
  {
      c.SwaggerDoc(&quot;v1&quot;, new OpenApiInfo { Title = &quot;ApiGateway&quot; });
  
      c.AddSecurityDefinition(&quot;Bearer&quot;,
          new OpenApiSecurityScheme
          {
              In = ParameterLocation.Header,
              Description = &quot;Please enter into field the word 'Bearer' following by space and JWT&quot;,
              Name = &quot;Authorization&quot;,
              Type = SecuritySchemeType.ApiKey
          });
  
      c.AddSecurityRequirement(new OpenApiSecurityRequirement
      {
          {
              new OpenApiSecurityScheme
              {
                  Reference = new OpenApiReference
                  {
                      Type = ReferenceType.SecurityScheme,
                      Id = &quot;Bearer&quot;
                  }
              },
              new string[] { }
          }
      });
      c.ExampleFilters();
  });
  </code></pre>
  <p>but it doesn't make sense..</p>