Possibility to use OAuth tokens under [SMTP] section in grafana.ini (for Gmail)?

Hello,

We have recently migrated our mail to gmail and the ‘forgot password’ utility stopped sending emails due to Grafana not being able to authenticate with gmail. The previous smtp provider accepted simple user and password based authentication but according to the link below Google doesn’t accept it anymore since May/2022 (the allow less secure app option has been removed)

You can authenticate with google using oauth tokens but I am having hard time to find out if this is possible for the smtp ie if it is possible to use tokens in [smtp] section of grafana.ini rather than username and passowrd? Does anyone know? Thank you.

  • What Grafana version and what operating system are you using? → 9

  • What are you trying to achieve? → send ‘forgot your password’ email via gmail

  • How are you trying to achieve it? by configuring grafana.ini file with the gmail details

  • What happened? I receive this error message

Failed to send notification to email addresses: address@domain 535 5.7.8 Username and Password not accepted. Learn more at\n5.7.8"

  • Can you copy/paste the configuration(s) that you are having problems with?

[smtp]
enabled = true
host:25=smtp.gmail.com
user =
password =
;cert_file =
;key_file =
;skip_verify = false
from_address =
from_name =

Hi @nobigmic,

Welcome to the :grafana: community support forums !!

As per our documentation for Google OAuth it does not have any section for SMTP to use the token;

But, I think that this option needs to be defined inside the Google Developer Console:

This is all I could dig up on this topic. I hope this helps.

1 Like

I will check the links provided. Thank you @usmanahmad.