title: Identity Server 4 - Identity Model Grant Types
body: <p>I am trying to implement Identity Model from <a href="https://github.com/IdentityModel/IdentityModel.OidcClient2" rel="nofollow noreferrer">here</a> , im trying to get the NetCoreConsoleClient working with my IdentityServer4 on my localhost:5000 and my Api also on my localhost:5001 </p>
  
  <p>My starting point is <a href="http://docs.identityserver.io/en/release/quickstarts/5_hybrid_and_api_access.html" rel="nofollow noreferrer">Quick start 5</a> Hybrid and Api flow. </p>
  
  <p>So Ive added the following Client to my IdentityServer4 code:</p>
  
  <pre><code>// Hybrid grant client
              new Client
              {
                  ClientId = "hclient",
                  AllowedGrantTypes = GrantTypes.Hybrid,
  
                  ClientSecrets =
                  {
                      new Secret("secret".Sha256())
                  },
                  AllowedScopes =
                  {
                      IdentityServerConstants.StandardScopes.OpenId,
                      IdentityServerConstants.StandardScopes.Profile,
                      "api1"
                  },
              }
  </code></pre>
  
  <p>In the NetCoreConsoleClient I have changes the following lines of code:</p>
  
  <pre><code>    static string _authority = "http://localhost:5000";
      static string _api = "http://localhost:5001";
  
  private static async Task SignIn()
      {
          // create a redirect URI using an available port on the loopback address.
          string redirectUri = string.Format("http://127.0.0.1:7890/");
  
          var options = new OidcClientOptions
          {
              Authority = _authority,
              ClientId = "hclient",
              RedirectUri = redirectUri,
              Scope = "OpenId Profile api1",
              FilterClaims = false,
              Browser = new SystemBrowser(port: 7890)
          };
  </code></pre>
  
  <p>I read in a posts comments <a href="https://leastprivilege.com/2016/06/01/identitymodel-openid-connect-oauth-2-0-client-library-for-mobilenative-applications/" rel="nofollow noreferrer">here</a> that I should use Hybrid flow grant type.</p>
  
  <p>The web browser opens but I keep getting:</p>
  
  <p><strong>Sorry, there was an error : unauthorized_client</strong></p>
  
  <p>What am I doing wrong?</p>