title: IdentityServer4 authenticate each client separately
body: <p>I use two different clients. The IdentityServer4 provides API protections and log in form. Can I configure clients to avoid single sign on. I mean that even if I logged in the first client I need to log in the second client too. </p>
  
  <p>My ID4 configuration: </p>
  
  <pre><code>internal static IEnumerable&lt;Client&gt; GetClients(IEnumerable&lt;RegisteredClient&gt; clients)
  {
      return clients.Select(x =&gt;
      {
          var scopes = x.AllowedScopes.ToList();
          scopes.Add(IdentityServerConstants.StandardScopes.OpenId);
          scopes.Add(IdentityServerConstants.StandardScopes.Profile);
          scopes.Add(IdentityServerConstants.StandardScopes.OfflineAccess);
  
          var client = new Client
          {
              ClientId = x.Id,
              ClientName = x.Name,
              AllowedGrantTypes = GrantTypes.Hybrid,
  
              RequireConsent = false,
  
              RefreshTokenExpiration = TokenExpiration.Sliding,
              RefreshTokenUsage = TokenUsage.ReUse,
  
              ClientSecrets = {new Secret(x.Secret.Sha256())},
              RedirectUris = new[] {$"{x.Url}/signin-oidc"},
              PostLogoutRedirectUris = new[] {$"{x.Url}/signout-callback-oidc"},
  
              UpdateAccessTokenClaimsOnRefresh = true,
  
              AllowAccessTokensViaBrowser = true,
              AllowedScopes = scopes,
              AllowedCorsOrigins = {x.Url},
              AllowOfflineAccess = true
          };
  
          return client;
      });
  }
  </code></pre>
  
  <p>All client have the same register code (Maybe it is a problem): </p>
  
  <pre><code>const string oidcScheme = "oidc";
  const string coockieScheme = CookieAuthenticationDefaults.AuthenticationScheme;
  
  services.AddAuthentication(options =&gt;
  {
      options.DefaultScheme = coockieScheme;
      options.DefaultChallengeScheme = oidcScheme;
  })
      .AddCookie(coockieScheme)
      .AddOpenIdConnect(oidcScheme, options =&gt;
      {
          options.SignInScheme = coockieScheme;
  
          options.Authority = identitySettings.Authority;
          options.RequireHttpsMetadata = false;
  
          options.ClientId = identitySettings.Id;
          options.ClientSecret = identitySettings.Secret;
  
          options.ResponseType = "code id_token";
  
          options.Scope.Add("offline_access");
          foreach (var scope in identitySettings.Scopes)
          {
              options.Scope.Add(scope);
          }
  
          options.GetClaimsFromUserInfoEndpoint = true;
          options.SaveTokens = true;
      });
  </code></pre>
  
  <p>any help will be useful.</p>