Only show these results:

Create a Azure App

This guide covers how to set up a Microsoft OAuth application to start authenticating O365 users via OAuth.

Create your free Microsoft Azure account if you don't already have one. You'll use this account to create the Microsoft developer application that is used for authenticating end users via OAuth with Nylas.

Staging and Production OAuth

Don't set up Office 365 on your production app before testing on your staging app. Once the OAuth settings are added, they can't be deleted.

Create an OAuth Application

First, create an app for authenticating your customers to Microsoft 365. Use the Azure web portal.

Log in to Azure

  1. Head to https://portal.azure.com and log in.
  2. In the menu, select Azure Active Directory.
  3. On the new menu select App Registrations.
  4. Then click New Registration.
Azure Portal Home

New App Registration

  1. Set your name to your app's name. This will be visible to your users.
  2. Set the audience for this app to Account in any organizational directory to be able to log in to any account using Office365. You can also restrict it to internal accounts, Accounts in this organizational directory only, if you're building an internal app.
  3. On the same screen, set the Redirect URI to Web
    1. If you are using Hosted Authentication use https://api.nylas.com/oauth/callback.
    2. If you are using Native Authentication use your app's callback URI.
Azure Register App

Congrats!

Congrats, you've just created your app!

Enable the Required APIs

To enable the required APIs, you need to add the permissions to the app Manifest.

Required Permissions

  • Azure Active Directory Graph
    • User.Read - Sign in and read user profile
  • Microsoft Graph
    • offline_access - Maintain access to data you have given it access to
    • openid - Sign users in
    • profile - View users' basic profile
    • User.Read - Sign in and read user profile
  • Office 365 Exchange Online
    • EAS.AccessAsUser.All - Access mailboxes via Exchange ActiveSync
    • EWS.AccessAsUser.All - Access mailboxes as the signed-in user via Exchange Web Services

Microsoft Graph for Events

Nylas offers Microsoft Graph for events. To enable this feature, reach out to our support team.

To get there from the Azure home page:

  1. Go to Home > Azure Active Directory > App Registrations.
  2. Click on your app name.
  3. Then click Manifest.
  4. In the Manifest code, look for requiredResourceAccess.

The Manifest allows you to update the app directly by editing the JSON. Learn more about the Manifest at Microsoft.

Azure App Manifest

Existing Manifest Data

If you already have values in requiredResourceAccess you will need to add to the existing data. if you need help with this, please reach out to Nylas support. To help get support faster, add Nylas to your application as a user.

  1. Update the requiredResourceAccess to have the Manifest code. If there are existing permissions, this will overwrite them.

Manifest JSON


"requiredResourceAccess": [


{
"resourceAppId": "00000002-0000-0ff1-ce00-000000000000",
"resourceAccess": [
{
"id": "266d2589-20b5-4f91-9a03-89247d1be8da",
"type": "Scope"
},
{
"id": "3b5f3d61-589b-4a3c-a359-5dd4b5ee5bd5",
"type": "Scope"
}
]
},
{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "14dad69e-099b-42c9-810b-d002981feec1",
"type": "Scope"
},
{
"id": "37f7f235-527c-4136-accd-4a02d197296e",
"type": "Scope"
},
{
"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
"type": "Scope"
},
{
"id": "7427e0e9-2fba-42fe-b0c0-848c9e6a8182",
"type": "Scope"
}
]
},
{
"resourceAppId": "00000002-0000-0000-c000-000000000000",
"resourceAccess": [
{
"id": "311a71cc-e848-46a1-bdf8-97ff7156d8e6",
"type": "Scope"
}
]
}
]
  1. Save the Manifest.
  2. All the necessary permissions have been added. To check the API permissions, click API Permissions from the menu.
Azure App Permissions

Create the OAuth Credentials

  1. From the App menu click Certificates & secrets.
  2. Click New client secret.
  3. Give the secret a name and an expiration date of 24 months. Click Add.
Azure add client secret
  1. Copy the value from the Client secrets page, and save it somewhere safe. Once you leave this page, you won't be able to retrieve the value afterward.

Azure Client secrets

Expiration Dates

Microsoft no longer allows client secret expirations of never.

Copy the Client ID

  1. In Azure, go to the App Registrations page and copy the Application (client) ID.
Azure client ID

Add Client ID and Secret to Nylas

  1. Go to your Nylas Dashboard / App Settings / Authentication section.
  2. Add the Client ID and Client Secret to Office 365 Auth, then click Save Changes.

Office365 Auth in Dashboard

Getting Ready for Production

Microsoft requires apps that access user data to go through a domain verification process. Reach out to Nylas support for more assistance.