title: How can I use the grant_type=password oauth flow with salesforce.com?
body: <p>I'm trying to get an authorization token using the Username-Password flow (as described in the final section of <a href="http://wiki.developerforce.com/page/Digging_Deeper_into_OAuth_2.0_on_Force.com" rel="nofollow noreferrer">this</a> article).</p>
  
  <p>I'm sending the following request (using Python's httplib, in case that's relevant): </p>
  
  <pre><code>https://login.salesforce.com/services/oauth2/token
  
  POST data:
  
  username=&lt;un&gt;&amp;client_secret=&lt;consumer_secret&gt;&amp;password=&lt;pw+token&gt;&amp;grant_type=password&amp;client_id=&lt;consumer_key&gt;
  </code></pre>
  
  <p>And getting the response:</p>
  
  <pre><code>400 Bad Request
  {"error":"unsupported_grant_type","error_description":"grant type not supported"}
  </code></pre>
  
  <p>Is the password grant_type really unsupported, or am I missing something? It seems to give this error even when I'm sending a grant_type that definitely does work (such as authorization_code).</p>
  
  <p>Note that I've tried the suggestions in the answer <a href="https://stackoverflow.com/questions/4970534/iphone-objective-c-oauth-2-0-login-unsupported-grant-type">here</a>, and they don't work for me.</p>