Skip to content

Create grants with Custom authentication

If you already have a refresh token (or credentials, if using IMAP) for your end users from your own authentication implementation, you can use it with the Nylas APIs to create a grant and get the grant_id, which you then use in requests to the provider. If you are handling the OAuth flow in your own application or want to migrate existing users, Custom auth allows you to simply provide the user refresh_token to create a grant.

Use API request for Custom authentication

The following examples show a POST /v3/connect/custom request and a sample response.

Use Nylas SDKs for Custom authentication

You can use the v3 Nylas SDKs to set up Custom auth, as in the examples below.

Creating a Custom auth login page

Nylas provides a login page for Hosted authentication that uses the detect provider API to route user logins to the correct provider.

If you’re using Custom authentication instead, you must create a login page for your app where your users enter their login credentials. This should be branded, and can use the Detect Provider endpoint to help route user logins to use the correct Connector.