Search code examples
firebasesendgrid

SendGrid integration with Firebase trigger email. Error: Invalid login: 535 Authentication failed


I have integrated SendGrid Email API with Firebase Trigger Email extension. When I tried to test this integration manually by creating a new document in email_collection in firebase console, I always get this error:

"Error: Invalid login: 535 Authentication failed: The provided authorization grant is invalid, expired, or revoked".

I successfully created an API Key using the SMTP Relay and use it in the SMTP connection URI when configuring the trigger email extension, so I'm not sure if the problem is within SendGrid credentials or in the firebase extension configuration.

This is a screenshot of my SMTP connection URI

I'm new to this topic, so any help will be appreciated.


Solution

  • Twilio SendGrid developer evangelist here.

    I recommend you use port 587. While port 465 is available, SendGrid recommends using port 587.

    Other than that, you should check that your API key has permission to send emails. And if it all looks correct, try generating a API key and confirming the permissions.