Skip to content
Skip to main content

Authenticating Microsoft accounts with Nylas

After you create an Azure application, your next step is deciding how to authenticate your users to Nylas.

Before you choose an authentication method, Nylas recommends you read the following documentation:

You also need to complete the following prerequisites for your production application:

Nylas includes an EWS connector that you can use to authenticate accounts hosted on Exchange on-premises servers. Other types of Exchange accounts must upgrade to use Microsoft Graph scopes, then authenticate using the Microsoft connector.

For more information, see Authenticate Exchange on-prem servers with Nylas.

Microsoft’s shared mailboxes are individual mailboxes that multiple users can access. Each shared mailbox has its own email address and password.

After you set a password for the shared mailbox, you can authenticate it with Nylas like any other Microsoft account. It functions as a regular user account with a grant in your Nylas integration.

Microsoft supports modern authentication/OAuth only. The flow follows these basic steps:

  1. Your Nylas application completes the OAuth process with Microsoft and receives a refresh_token for the user’s account.

  2. Your application makes a Bring Your Own Authentication request to Nylas using the user’s refresh_token.

    curl --request POST
    --url 'https://api.us.nylas.com/v3/connect/custom' \
    --header 'Accept: application/json, application/gzip' \
    --header 'Authorization: Bearer <NYLAS_API_KEY>'\
    --header 'Content-Type: application/json' \
    --data '{
    "provider": "microsoft",
    "settings": {
    "refresh_token":"<REFRESH_TOKEN>"
    },
    "state": "<STATE>"
    }'
  3. Nylas creates a grant for the user and returns its details.