title: Salesforce returning "unsupported_grant_type"
body: <p>We implemented OAuth 2.0 using Web Server Authentication Flow. It was working fine in October/November but all of a sudden it has stopped working. Whenever we try authorising another client the server return (400) Bad Request with the body</p>
  
  <pre><code>{"error":"unsupported_grant_type","error_description":"grant type not supported"}
  </code></pre>
  
  <p>grant_type is set as authorization_code which is definitely valid. </p>
  
  <p>Is there any reason why OAuth would suddenly stop working?</p>
  
  <hr>
  
  <p>This is how we have implemented OAuth:</p>
  
  <p>First user is directed to: <a href="https://login.salesforce.com/services/oauth2/authorize?response_type=code&amp;client_id=blah.id&amp;redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx&amp;scope=api%20refresh_token" rel="noreferrer">https://login.salesforce.com/services/oauth2/authorize?response_type=code&amp;client_id=blah.id&amp;redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx&amp;scope=api%20refresh_token</a></p>
  
  <p>User is prompted by Salesforce to login to their account. </p>
  
  <p>Once user is authenticated Salesforce calls Callback.aspx, Callback.aspx requests refresh token on behalf of the client by making a POST request to: <a href="https://login.salesforce.com/services/oauth2/token" rel="noreferrer">https://login.salesforce.com/services/oauth2/token</a> with the payload: </p>
  
  <p>grant_type=authorization_code&amp;code=blah.code&amp;client_id=blah.Id&amp;client_secret=11111111&amp;redirect_uri=https://domain.com/Web/Salesforce/Callback.aspx</p>
  
  <p>Content type is definitely: application/x-www-form-urlencoded</p>