office365apimicrosoft-graph-apioutlook-web-appoutlook.com

How do you authorize Outlook.com with Microsoft Graph?


Cut my life into pieces, this is my last resort.

Seriously, I can't find this info anywhere! I thought Graph supported Outlook.com. I saw this question which referenced the Outlook Api vs the Graph Api, but how do I authorize an Outlook.com account for this?

I'm sending the user to https://login.microsoftonline.com/common/oauth2/authorize with the parameters:

response_type = code
client_id = <my client id>
redirect_uri = <my redirect_uri>
state = <csrf>
resource = https://outlook.office.com/

to sign in. It takes them to the Office 365 sign in, and when you type @outlook.com, it tries to redirect you, only to go back to the 365 login page and do it all over.

I can authorize Office 365 just fine, but not Outlook.com. I can provide more info if needed, I just figure I'm hitting the wrong endpoint or something.


Solution

  • Currently we have two versions of the authentication endpoint. The version less endpoint (https://login.microsoftonline.com/common/oauth2/authorize) only supports work and school accounts (Office365) the v2.0 auth endpoint (https://login.microsoftonline.com/common/oauth2/v2.0/authorize) supports both work and school and personal accounts. To use a personal account (hotmail.com, outlook.com, live.com) with Microsoft Graph, you start by registering you app in apps.dev.microsoft.com, then follow the instructions in this article:
    https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-scopes/. Try that and let me know how it goes.