title: Can't authenticate user in Identity Server
body: <p>I am trying to authenticate user in Identity Server 4 via <strong>/connect/token</strong> endpoint. I am filling all required fields in Postman:</p>
  
  <ul>
  <li>grant_type</li>
  <li>username</li>
  <li>password</li>
  <li>client_id</li>
  <li>client_secret</li>
  </ul>
  
  <p>and I always get "<strong>invalid_client</strong>" response.</p>
  
  <p>I have inserted values in next tables:</p>
  
  <ul>
  <li>AspNetUsers</li>
  <li>Clients</li>
  <li>ClientGrantTypes</li>
  <li>ClientSecrets</li>
  </ul>
  
  <p>For table AspNetUsers in column PasswordHash I have added hashed password that is hashed with SHA256. In ClientGrantTypes I have added GrantType with value 'password' and inserted proper ClientId.</p>
  
  <p>This is how my ConfigureServices look like:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      string connectionString = "Server=192.168.1.108; Port=5432; Database=Users; User Id=postgres;Password=RandomPassword123";
      var migrationsAssembly = typeof(Startup).GetTypeInfo().Assembly.GetName().Name;
  
      services.AddIdentityServer()
          .AddConfigurationStore(options =&gt;
          {
              options.ConfigureDbContext = builder =&gt;
              {
                  builder.UseNpgsql(connectionString, action =&gt;
                  {
                      action.MigrationsAssembly(migrationsAssembly);
                  });
              };
          })
          .AddAspNetIdentity&lt;Users&gt;().AddConfigurationStore(options=&gt;
          {
              options.ConfigureDbContext = builder =&gt;
              {
                  builder.UseNpgsql(connectionString, action =&gt;
                  {
                      action.MigrationsAssembly(migrationsAssembly);
                  });
              };
          }).AddDeveloperSigningCredential();
  
  
      services.AddEntityFrameworkNpgsql();
      services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
  }
  </code></pre>
  
  <p>I am struggling to figure out what am I doing wrong, so any help would be appreciated.</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>I have included logging. This is the screenshot of what I have in Postman:
  <a href="https://i.imgur.com/Sk78V2y.png" rel="nofollow noreferrer">http://i.imgur.com/Sk78V2y.png</a></p>
  
  <p>And this is full log of Identity Server:</p>
  
  <blockquote>
    <p>[21:25:46 Debug] IdentityServer4.Hosting.EndpointRouter Request path
    /connect/token matched to endpoint type Token</p>
    
    <p>[21:25:46 Debug] IdentityServer4.Hosting.EndpointRouter Endpoint
    enabled: Token, successfully created handler:
    IdentityServer4.Endpoints.TokenEndpoint</p>
    
    <p>[21:25:46 Information]
    IdentityServer4.Hosting.IdentityServerMiddleware Invoking
    IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for
    /connect/token</p>
    
    <p>[21:25:46 Debug] IdentityServer4.Endpoints.TokenEndpoint Start token
    request.</p>
    
    <p>[21:25:46 Debug] IdentityServer4.Validation.ClientSecretValidator
    Start client validation</p>
    
    <p>[21:25:46 Debug]
    IdentityServer4.Validation.BasicAuthenticationSecretParser Start
    parsing Basic Authentication secret</p>
    
    <p>[21:25:46 Debug] IdentityServer4.Validation.SecretParser Parser found
    secret: BasicAuthenticationSecretParser</p>
    
    <p>[21:25:46 Debug] IdentityServer4.Validation.SecretParser Secret id
    found: Ryukote</p>
    
    <p>[21:25:46 Debug] IdentityServer4.EntityFramework.Stores.ClientStore
    Ryukote found in database: False</p>
    
    <p>[21:25:46 Error] IdentityServer4.Validation.ClientSecretValidator No
    client with id 'Ryukote' found. aborting</p>
  </blockquote>
  
  <p>Log is confusing me cause there are stuff that are not true. That can be confirmed by looking at Postman screenshot I provided.</p>