Only show these results:
public-beta-v3

Configuring the OAuth login prompt

The Nylas API v3 is in public beta. It might contain bugs, and might change before it is generally available. See the v3 Beta documentation for more information.

If you use Nylas's Hosted OAuth, the first step of the process is to direct your end-users to a login prompt so they can authenticate with their service provider. If your project is available to end users of a large number of service providers, this can look complicated to end-users.

When you direct a user to api.us.nylas.com/v3/connect/auth, you can pass several query parameters in the URL that change how Nylas displays the login prompt.

Nylas provides the provider query parameter to allow you to skip the selection process, the detect provider utility API endpoint, and the prompt query parameter to allow you to streamline and customize this process.

Customize by setting a provider parameter

When you direct a user to api.us.nylas.com/v3/connect/auth, you can pass the provider query parameter to allow you to skip or configure the selection process.

If you only have one connector, Nylas skips the user directly to the login prompt for that provider, regardless of the provider query parameter.

If you already know the end-user's provider, you can pass it as the optional provider parameter, and Nylas takes the user directly to the login prompt for that specific provider.

If you don't know the end-user's provider you can omit the provider parameter. Nylas then displays a login prompt with an option each of the Google and Microsoft connectors configured for your Nylas application. If the application has an IMAP connector configured, Nylas also displays a View all providers link at the bottom of the login prompt to help users search for a specific IMAP provider.

You can also pass the provider parameter with a comma separated list of the most-often used providers for your project, and Nylas displays those providers as buttons on the login prompt in the order you specified. IMAP providers do not appear on directly the login prompt unless specified this way, so this is especially helpful if many of your users are on a specific IMAP provider.

Customize by setting the prompt parameter

You can also configure the login prompt by passing a prompt query parameter. If you set a provider query parameter, the prompt parameter is ignored.

The following options are available:

You can also pass both options in a preferred order, for example prompt=detect,select_provider. This allows you to show the user the list of providers if Nylas is unable to automatically determine their provider.

Using the provider detection endpoint

You can use the POST /v3/providers/detect API endpoint to query for a provider given a user's email address.

You can also pass prompt=detect to have Nylas attempt to detect the provider from the login prompt.

List of valid providers

  • google
  • microsoft
  • icloud
  • yahoo
  • aol
  • outlook
  • verizon
  • 126
  • 139
  • 163
  • fastmail
  • gandi
  • gmx
  • hover
  • soverin
  • mail.ru
  • namecheap
  • tiliq
  • yandex
  • zimbra
  • godaddy
  • 163_ym
  • 163_qiye
  • 123_reg
  • yeah.net
  • qq
  • foxmail
  • qq_enterprise
  • aliyun
  • gmail
  • web.de_freemail
  • t-online
  • zoho
  • zoho_custom_domain
  • zoho_eu
  • att
  • comcast
  • aim
  • earthlink
  • mail.com

IMAP special value that allows you to specify your own config (host/port):

  • generic