Nylas Hosted Authentication Not Working

I have followed the documentation to the T and created a Google GCP external account with the required permissions. I have also created a connector on my nylas dashboard for google using my google client id and secrete plus google pub/sub project id.


I am trying to authenticate users using the nylas hosted authentication urlForOAuth2 method. I am able to detect the provider successfully using the auth.detectProvider and the url has been generated successfully but then I get an error indicating the request is not allowed. I don’t know what I am doing wrong but I believe I don’t have to verify my app for this to work with hosted authentication?


Hello @backgroundbuddy

Have you gone to the Hosted Authentication tab on the V3 Dashboard? After that you need to go to Callback URIs and add your URL like this…

Thanks @Blag that was the key but even with hosted authentication, google is still warning my app is not verified, is that the normal behaviour?

Also I am unsure which of the events for messages will be triggered when the user receives a new message in my app? I checked the events for messages and couldn’t find that


Can you please let me know which one can help in my case?

Also please let me know how I can fetch the next bulk of messages if I want to fetch them in batches. I can see a nextCursor attribute, but I don’t know how that works.

@backgroundbuddy That would be message.created :slight_smile:

Regarding app is not verified that is normal if you’re on a Sandbox environment…if you want your app to be verified you would need to talk with support and/or sales.

1 Like

@backgroundbuddy To use nextCursor you can call the messages endpoint Nylas v3 Email, Calendar, and Contacts API docs | Nylas Docs and pass it to this parameter:

That’s a lot @Blag, that’s absolutely helpful.

1 Like

Hey @Blag I also mentioned the webhook event to receive a new message from a user. please can you help with that. :pray: