title: Invalid HTTP request for token endpoint in IdentityServer4
body: <p>Using IDS4 with debug tracing, the log only gives me a little bit to go on. I'm receiving the above error (Invalid HTTP request for token endpoint) when I post like so:</p>
  
  <pre><code>Request starting HTTP/1.1 POST http://localhost:5000/connect/token?grant_type=password&amp;client_id=resClient&amp;client_secret=TopSecret&amp;username=admin&amp;password=admin123
  </code></pre>
  
  <p>On the client side (web browser) I just get </p>
  
  <pre><code>{ "error": "invalid_request" }
  </code></pre>
  
  <p>The whole debug log looks like this:</p>
  
  <pre><code>dbug: Microsoft.AspNetCore.Server.Kestrel[1]
        Connection id "0HL2NGBR0Q1O4" started.
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
        Request starting HTTP/1.1 POST http://localhost:5000/connect/token?grant_type=password&amp;client_id=resClient&amp;client_secret=TopSecret&amp;username=admin&amp;password=admin123  0
  dbug: Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationMiddleware[9]
        AuthenticationScheme: idsrv was not authenticated.
  dbug: IdentityServer4.Hosting.EndpointRouter[0]
        Request path /connect/token matched to endpoint type Token
  dbug: IdentityServer4.Hosting.EndpointRouter[0]
        Mapping found for endpoint: Token, creating handler: IdentityServer4.Endpoints.TokenEndpoint
  info: IdentityServer4.Hosting.IdentityServerMiddleware[0]
        Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token
  trce: IdentityServer4.Endpoints.TokenEndpoint[0]
        Processing token request.
  warn: IdentityServer4.Endpoints.TokenEndpoint[0]
        Invalid HTTP request for token endpoint
  trce: IdentityServer4.Hosting.IdentityServerMiddleware[0]
        Invoking result: IdentityServer4.Endpoints.Results.TokenErrorResult
  info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
        Request finished in 348.2168ms 400 application/json
  dbug: Microsoft.AspNetCore.Server.Kestrel[9]
        Connection id "0HL2NGBR0Q1O4" completed keep alive response.
  </code></pre>
  
  <p>My code is pretty sparse. Here's the Startup.cs:</p>
  
  <pre><code>namespace IDServer4Test
  {
      public class Startup
      {
          public void ConfigureServices(IServiceCollection services)
          {
  
              services.AddIdentityServer()
              .AddTemporarySigningCredential()
              .AddInMemoryClients(Configurations.Clients.GetClients())
              .AddInMemoryApiResources(Configurations.Scopes.GetApiResources());
              services.AddTransient&lt;IResourceOwnerPasswordValidator, Configurations.ResourceOwnerPasswordValidator&gt;();
              services.AddTransient&lt;IProfileService, Configurations.ProfileService&gt;();
          }
  
          public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
          {
              loggerFactory.AddConsole(LogLevel.Trace);
  
              app.UseIdentityServer();
          }
      }
  }
  </code></pre>
  
  <p>Clients.cs:</p>
  
  <pre><code>public class Clients
  {
      public static IEnumerable&lt;Client&gt; GetClients()
      {
          return new List&lt;Client&gt;
      {
          new Client
          {
              ClientId = "resClient",
              ClientSecrets = { new Secret("TopSecret".Sha256()) },
  
              AllowedGrantTypes = GrantTypes.ResourceOwnerPasswordAndClientCredentials,
              AllowedScopes = { "myAPI" }
          }
      };
      }
  }
  </code></pre>
  
  <p>And Scopes.cs:</p>
  
  <pre><code>public class Scopes
  {
      public static IEnumerable&lt;ApiResource&gt; GetApiResources()
      {
          return new List&lt;ApiResource&gt;
          {
              new ApiResource("myAPI", "My API")
          };
      }
  }
  </code></pre>
  
  <p>I should be getting back a token response from IdentityServer but just keeps coming back with this error. Any ideas?</p>