OAuth2 with Azure AD - Not getting user consent
<p>I am trying to get the OAuth2 workflow to perform correctly for Azure AD. I am following the directions from this source: <a href="https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/azure/dn645542.aspx</a></p>

<p>I can successfully get an authorization code response by using this request:
<code>https://login.microsoftonline.com/[app-endpoint-id]/oauth2/authorize?response_type=code&amp;client_id=[client-id]&amp;redirect_uri=[redirect-uri]</code></p>

<p>I then use the authorization code to request an access token with a http post like so (I am testing this using Postman):</p>

<pre><code>POST /[app-endpoint-id]/oauth2/token HTTP/1.1 Host: login.microsoftonline.com Cache-Control: no-cache Postman-Token: ed098281-9aa4-6e5f-915d-0253d9a876d3 Content-Type: application/x-www-form-urlencoded

grant_type=authorization_code&amp;client_id=[client-id]&amp;code=[authorization_code]&amp;redirect_uri=[redirect_uri]&amp;client_secret=[client-secret]&amp;resource=[app-url]
</code></pre>

<p>I get the following error message from the POST request:</p>

<blockquote>
  <p>{"error":"invalid_grant","error_description":"AADSTS65001: The user or
  administrator has not consented to use the application with ID
  'app-id'. Send an interactive authorization request for this user and
  resource.\r\nTrace ID: trace-di\r\nCorrelation ID:
  correlation-id\r\nTimestamp: 2016-01-13
  17:18:39Z","error_codes":[65001],"timestamp":"2016-01-13
  17:18:39Z","trace_id":"trace-id","correlation_id":"correlation-id"}</p>
</blockquote>

<p>If I clear my cache and make the first request for the authorization code I will be redirected to log in. However, I don't get any way to authorize my app after logging in like it says I should in this documentation: </p>

<p><code>//azure.microsoft.com/en-us/documentation/articles/active-directory-integrating-applications/</code></p>

<p>What am I doing wrong here? I am trying to get an access token.</p>