After you create an Azure application, your next step is deciding how to authenticate your users to Nylas.
Before you begin
Section titled “Before you begin”Before you choose an authentication method, Nylas recommends you read the following documentation:
- Hosted Authentication with an API key
- Hosted Authentication with an access token
- Bring Your Own Authentication
You also need to complete the following prerequisites for your production application:
Authenticate Exchange accounts
Section titled “Authenticate Exchange accounts”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.
Authenticate Microsoft shared mailboxes
Section titled “Authenticate Microsoft shared mailboxes”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.
Set up Bring Your Own Authentication
Section titled “Set up Bring Your Own Authentication”Microsoft supports modern authentication/OAuth only. The flow follows these basic steps:
-
Your Nylas application completes the OAuth process with Microsoft and receives a
refresh_tokenfor the user’s account. -
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>"}' -
Nylas creates a grant for the user and returns its details.