Office365 API Authentication - Azure Application Registration Portal vs

I am creating a Node application that uses OAuth2 to log in a user and use the Office365 API to send and receive email and possibly contacts and calendar events.

I do not need the Azure Active Directory agent that I know of. However, I'm not sure if I need to register the application using Azure for the OAuth stream.

First, I followed this tutorial , which includes registering an application in the "Application Registration Portal." Now the OAuth token that I get works with the REST API for Outlook. No lazuri.

Then I saw this tutorial , which seems to suggest that any application using the Office365 API should register an application with Azure. I do not want to do this if I do not need it, mainly because of the cost.

I don’t understand why I need to register for one or the other, and my main problem is that the first tutorial is timed for the fact that registering my application with the "Application Registration Portal" will become obsolete and at some point I will need to switch to Registration with Azure. I have seen a lot of outdated manuals and information from MS that are not explicitly designated as outdated. Can someone help clarify this?

+4
source share
1 answer

Sorry for the confusion. The short answer is that both of these methods are still relevant, so none of them have been deprecated yet.

First, you are correct that you need to register your application to call the Office 365 API.

And you are also right that there are currently two different places to register an application: the Application Registration Portal and the Active Directory section in the Azure Management Portal .

Registering on one of them is enough for you to be in a convenient state where you can call the Office 365 API.

However, the convergence of the Outlook.com stack with the Exchange stack means that now you can also use Office Mail Mail, Calendar and the Office 365 Contacts API for Outlook.com accounts in addition to Office 365 accounts. If you want to take advantage of this, you must register Your application is in the application registration portal, not in the Azure management portal.

Another advantage of registering through the application registration portal is support for dynamic permission areas. When registering the application, you do not need to indicate what permissions are required; rather, you can request runtime permissions using the scopes parameter.

This new application model v2 for applications registered on the application registration portal is currently in preview mode. The reason for not registering applications in the application registration portal is that they will use more than just the API letters, calendars and contacts. for example, if your application also uses the OneDrive API for business files, you will not be able to request tokens using the v2 application model endpoint. In this case, you must register your application in the Active Directory section of the Azure Management Portal.

+4
source

All Articles