title: Identity Server 4 Swagger Authentication
body: <p>I'm currently having issues using swagger to authorize an api call to identity server 4.<br>
  My swagger dependency is using swashbuckle version 
  -beta client object in the identity server 4 looks like</p>
  
  <pre><code>new Client
  {
      ClientId="swagger",
      Enabled = true,
      ClientName="Swagger",
      AllowedGrantTypes = GrantTypes.Implicit,
      ClientSecrets = new List&lt;Secret&gt;
      {
          new Secret("secret".Sha256())
      },
      AllowedScopes = new List&lt;string&gt;
      {
          "apil"
      },
      RedirectUris = new List&lt;string&gt;
      {
          "http://localhost:15138/swagger/ui/popup.html"
      },
      AllowedCorsOrigins = new List&lt;string&gt;
      {
          "http://localhost:15138",
          "http://localhost:15138"
      },
      AllowAccessTokensViaBrowser = true,
      AllowAccessToAllScopes= true
  }
  </code></pre>
  
  <p>The client object is the identity server 4 model
  in the configure method for authentication I have this</p>
  
  <pre><code>app.UseIdentityServer();
  JwtSecurityTokenHandler.DefaultInboundClaimTypeMap = new Dictionary&lt;string, string&gt;();
  app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions
  {
      Authority = "http://localhost:15138/",
      ScopeName = "apil",
      RequireHttpsMetadata = false,
  
  });
  </code></pre>
  
  <p>Using fiddler my get request looks like this</p>
  
  <blockquote>
    <p>GET
    /connect/authorize?state=9321480892748389&amp;nonce=5279296493808222&amp;client_id=swagger&amp;redirect_uri=http%3A%2F%2Flocalhost%3A15138%2Fswagger%2Fui%2Fpopup.html&amp;response_type=id_token%20token&amp;scope=apil
    HTTP/1.1</p>
  </blockquote>
  
  <p>All the necessary parameters are there, the client has the corresponding client id, but The response I get back is a redirect to an error page with the message of an invalid request. I was anticipating a login page to pass in credentials or something similar to get authorized I was wondering what I did wrong for that to happen.</p>