Only show these results:
public-beta-v3

Creating Grants with IMAP Authentication

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.

Step 1 - Create a connector

IMAP does not support the concept of scopes - so you do not need to provide them during the authentication process.

POST /v3/integrations

{
"name": "Staging App 1",
"provider": "imap"
}

Step 2A - Native Auth for Yahoo

Yahoo does not support OAuth, so instead of providing a refresh token, you need to provide a username, password, host, port, and type during the Custom Auth process.

POST /v3/connect/custom

{
"provider": "imap",
"settings": {
"imap_username": "[email protected]",
"imap_password": "super-secret-app-password",
"imap_host": "imap.mail.yahoo.com",
"imap_port": 993,
"type": "yahoo"
}
}

Step 2B - Hosted Auth for Yahoo

Nylas Support Hosted Authentication for Yahoo. In order to redirect to the UI for end users to login in using their Yahoo accounts, settings.type must be set to yahoo during the API request

POST /v3/connect/auth

{
"provider": "imap",
"redirect_uri": "http://localhost:3000",
"settings": {
"type": "yahoo"
}
}

Once this setup is complete, please proceed with the exact same steps as specified in the Hosted Authentication documentation

Error handling

  • An IMAP hosted authentication has very specific events including invalid_authentication, provider_not_responding and auth_limit_reached.
  • If the IMAP provider (eg: Yahoo IMAP server) did not respond to the login request from Nylas, the login asynchronous validation shows the proper error message for provider_not_responding event.
  • If the Provider responded with incorrect credential error, user is prompted with an error message. For Yahoo we will hint the user and link them to Yahoo guide for creating an application password.
  • If user entered the wrong password 3 times incorrectly instead of an error message, Nylas hosted authentication redirects back to your application redirect_uri with the error code for auth_limit_reached.
  • A grant is only created for IMAP if all the validations have passed successfully for the IMAP settings and credentials.

What's Next?

Now that you have created a Connector and received a Grant, you can: