Reputation: 125
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:
https://login.microsoftonline.com/common/oauth2/authorize?client_id=123451234512345&response_type=code&redirect_uri=https://www.my-site.com/oauth-callback/microsoft
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.
Upvotes: 1
Views: 5386
Reputation: 685
This is a great video explaining the login process: https://www.youtube.com/watch?v=HOcwvuIJHXA "Deep Dive into the Office 365 RESTful APIs". It is very long, but detailed. Around 25:00 it shows with Fiddler how the login works. Helped me a lot.
Upvotes: 0
Reputation: 1806
To get a code you need to pass the following parameters:
Finally, thank you for the feedback, can you please point the articles you read where the information was not clear so we can make sure to update them? I suggest you try the following article: https://graph.microsoft.io/docs/platform/rest
Upvotes: 4