If you’re using Nylas’ Hosted Authentication in your project, the first step of the process is to direct your users to a login prompt where they can authenticate with their provider. If your users are distributed across a number of service providers, this can become complicated.
Use query parameters to customize login prompt
When you direct a user to api.us.nylas.com/v3/connect/auth
, you can pass several query parameters that change how Nylas displays the login prompt.
Use provider
to customize login prompt
You can include the provider
query parameter in your GET /v3/connect/auth
request to configure or skip the provider selection process. If you already know the user’s provider, you can pass it in the provider
parameter. Nylas automatically directs the user to that provider’s login prompt.
If your project has only one connector, Nylas directs the user to the provider login prompt immediately, regardless of the provider
query parameter.
If you don’t know the user’s provider, you can omit the provider
parameter. In this case, Nylas displays a login prompt where the user can choose from the providers your project has configured connectors for.
You can also pass the provider
parameter with a comma-separated list of the most-often used providers for your project. Nylas displays the list of providers as buttons on the login prompt, in the order specified. IMAP providers don’t appear on the login prompt unless specified this way, so this is especially helpful if many of your users are authenticating with a specific IMAP provider.
Use prompt
to customize login prompt
If you’ve already set the provider
query parameter in your GET /v3/connect/auth
request, Nylas ignores the prompt
parameter.
The prompt
query parameter supports the following options:
detect
: Use thePOST /v3/providers/detect
endpoint to determine the user’s provider, and display only that provider on the login prompt.select_provider
: Display the full list of providers on the login prompt, even if your project has only one connector.
You can pass both options in your preferred order (for example, prompt=detect,select_provider
shows the full list of providers if Nylas can’t determine the user’s provider).
Automatically detect user’s provider
You can use the POST /v3/providers/detect
endpoint to query for the user’s provider based on their email address, and direct them to the appropriate login prompt.
Supported providers
Popular OAuth providers
google
microsoft
Popular IMAP providers
icloud
yahoo
aol
outlook
verizon
Other IMAP providers
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