title: How do I get an access token from Microsoft Graph API?
body: <p>I'm currently dealing with the fascinatingly confusing world of Microsoft. I've read several of the half-baked tutorials on how to use their Graph API and Office 365 API and I still don't really know what to do. What I HAVE figure out is how to build that authorization request URL so I can get the "code", which is supposed to be used to then get the access token. I've done this with the Google API and it works beautifully, but not with the Microsoft Graph API. Here's what I have:</p>
  
  <pre><code>https://login.microsoftonline.com/common/oauth2/authorize?client_id=123451234512345&amp;response_type=code&amp;redirect_uri=https://www.my-site.com/oauth-callback/microsoft
  </code></pre>
  
  <p>When the user clicks on this link, they are taken to the Microsoft login page. So far, so good. But, after entering my login credentials it just takes me right back to the same Microsoft login page, as opposed to redirecting the user to my redirect uri. I have an Azure account with the same redirect URI specified, but it just isn't working. What am I doing wrong? By the way, I'm using node.js. Any links to useful tutorials would be much appreciated. </p>