title: c# Identity Server Bad Request - Request Too Long
body: <p>I have an odd issue that I am trying to track down.</p>
  
  <p>If I deploy my client and Identity Server to Azure, using a self signed certificate then the code works.</p>
  
  <p>I have now moved it to our UAT environment, where the identity server is configured to use a purchased certificate. This certificate has been provided for a single domain. identity.mydomain.com</p>
  
  <p>The client has the password for this certificate so it can do what it needs to.</p>
  
  <p>When I browse to the identity server I can log in to the admin section, so that is all running correctly. If I browse to the client, it redirects to the identity service where I can log in. But as soon as I log in, and am redirected back to my website, I get the following error;</p>
  
  <pre><code>Bad Request - Request Too Long
  
  HTTP Error 400. The size of the request headers is too long.
  </code></pre>
  
  <p>Looking at the cookies, I can see a whole load of cookies created. I have deleted those and restarted, but I still have the same issue.
  If I increase the size of the buffers by using.</p>
  
  <pre><code>&lt;httpRuntime maxRequestLength="2097151" executionTimeout="2097151"&gt;
  </code></pre>
  
  <p>Then it works, but I am concerned that I am masking a problem rather than fixing it.</p>
  
  <p>Has anyone else had to do this to get identity server to work on iis?</p>