0

Actually I'm a beginner in node.js so please do excuse me if my question is foolish. Basically I'm sending email by using my gmail account via node-mailer . But now I want to know is it necessary to use o auth with node-mailer . Can anyone please define the importance and necessity of o auth ?

Srinivas Nahak
  • 1,846
  • 4
  • 20
  • 45
  • 1
    Not necessarily. You can just go to your gmail account and activate less secure apps to use node mailer. https://www.google.com/settings/security/lesssecureapps – souravlahoti Apr 26 '18 at 06:14
  • For benefit of OAuth you can check this https://stackoverflow.com/questions/7561631/oauth-2-0-benefits-and-use-cases-why – souravlahoti Apr 26 '18 at 06:18

1 Answers1

1

OAuth enables your application to store and use authentication tokens instead of actual login credentials. Hence these tokens can be used only for specific actions and can be revoked back once the job is done. Even if the tokens are stolen there would be no harm to the actual credentials as they are unknown.

Another good thing about OAuth is it is "short-lived" and you'll have this regenerated every time when you authenticate something.

Hope this helps!

David R
  • 14,711
  • 7
  • 54
  • 72