Skip to content

Authenticating with Nylas

Nylas offers a few different authentication methods, so you can choose the best one for your project. This page explains each authentication type and how to set up the auth flow for your project.

Most Nylas applications should use the Hosted OAuth and API key method. This gives your users the familiar security of OAuth, but removes the need for refresh token management after the initial token exchange.

When you know what type of authentication you want to use, go on to the steps below.

  1. If you haven’t already, log in to the Nylas Dashboard and create a Nylas application.
  2. Get your application’s API key.
  3. Create auth apps for the providers you plan to integrate with.
  4. Create connectors for your provider auth apps. Nylas supports Google, Microsoft, IMAP, Exchange on-premises, iCloud, Yahoo, and Zoom Meetings.
  5. Add your project’s callback URIs to your Nylas application.
  6. Authenticate your users and create grants for them.

If you expect to connect to Google or Microsoft accounts, you’ll need to create a provider auth app to connect to their servers.

You can use provider auth apps with internal company accounts for development and testing with no extra steps. You’ll need to get it reviewed by the provider, however, before you can “go live” with your project. We recommend you maintain a provider auth app for each of your environments so you can make changes in your development and testing environments without affecting your production users.

Creating a provider auth app is straightforward, and you can create one (or several) quickly so you can start developing. The provider review can take several weeks, however, and depends entirely on the provider’s review process and which scope your project requests. Be sure to plan this into your development timeline!

You might need to take extra steps to comply with Google’s OAuth 2.0 policies and complete their verification process before you can publish your Google auth app.

Be sure you’re requesting only the most restrictive scopes that you need for your project. If you request any of Google’s restricted scopes, Google requires your application to complete a security assessment. This could extend your verification timeline significantly or cause Google to fail your review.

For more information, see our Google verification and security assessment guide.

You can’t create your own connectors or change scopes on a Nylas Sandbox application. Sandbox applications include a limited set of pre-configured connectors you can use to test your authentication flow.

Connectors store information about the external services you connect to your Nylas application, so you don’t need to include them manually in all API calls. You can’t create grants for your users without at least one connector.

You only need one connector per provider for each Nylas application, and you can create them by either logging in to the Nylas Dashboard and selecting Connectors from the left navigation, or making a Create Connector request.

You can configure default scopes for each connector. This is a good way to simplify your calls later if you know that all users using a specific connector will require the same scopes. You can also override these default scopes by specifying different scopes when you create a grant.

Bulk auth grants and connector credentials

Section titled “Bulk auth grants and connector credentials”

Nylas also supports Bulk authentication grants (sometimes called “Service Accounts” or “app permissions”) which you can use to do bulk re-authentication and other backend tasks.