title: How to do OAuth2 Authorization in ASP.NET Core for Swagger UI using Swashbuckle
body: <p>Swashbuckle OAuth2 Authorization with Client Credentials Flow in <code>DotNet Core 2</code></p>
  
  <p>I want to set Implicit <code>Flow</code>, <code>AuthorizationUrl</code>, different <code>Scopes</code>, default selected <code>Client-id</code>,
  so, after clicking authorize, it should navigate to different tab, opening <code>AuthorizationUrl</code> and make user logged in <code>Swagger</code>. So, next time user can see <code>log out</code> option.</p>
  
  <pre><code>services.AddSwaggerGen(c =&gt;
  {
      c.SwaggerDoc("v1", new Info()
      {
          Title = "",
          Description = "All rights reserved."
      });
  
  
      c.AddSecurityDefinition("oauth2", new OAuth2Scheme
      {
          Flow = "implicit",
          AuthorizationUrl = "https://...",
          Scopes = new Dictionary&lt;string, string&gt; {
              { "", "Read/Write" }
          }
  
      });
  });
  </code></pre>
  
  <p>and <code>Configure()</code> having,</p>
  
  <pre><code>app.UseSwagger();
  app.UseSwaggerUI(c =&gt; {
      c.SwaggerEndpoint("/swagger/v1/swagger.json", "iModelAcquisitionService");
  });
  </code></pre>