title: Using curl and Oauth2 client_credentials with Azure AD Graph API
body: <p>I am trying to get an access token from Microsoft's Azure AD Graph API using curl, but I keep getting a 400 Bad Request.</p>
  
  <p>Here is the command I'm running:</p>
  
  <pre><code>curl -v --data "grant_type=client_credentials&amp;client_id=&lt;my id&gt;&amp;client_secret=&lt;my secrect&gt;"  https://login.windows.net/&lt;my app guid&gt;/oauth2/token?api-version=1.0
  </code></pre>
  
  <p>The response I get is:</p>
  
  <p>{"error":"invalid_request","error_description":"ACS90004: The request is not properly formatted.\r\nTrace ID: 095ca93a-744c-41b1-b531-0db5b8ec9e07\r\nCorrelation ID: 46eb70ad-6053-498a-8fd5-6ee7b52d5e72\r\nTimestamp: 2013-11-07 17:51:15Z","error_codes":[90004],"timestamp":"2013-11-07 17:51:15Z","trace_id":"095ca93a-744c-41b1-b531-0db5b8ec9e07","correlation_id":"46eb70ad-6053-498a-8fd5-6ee7b52d5e72"}</p>