2

I am using my own command line email program (written in C) to send emails. As of 30th May 2022 Google have discontinued using insecure app passwords to authenticate, which was required to bypass their requirement for 2-step authentication.

How do I include the two-step authentication code in my C program to so that I can continue sending email through a Gmail account?

Please note that I need to have the C email program independent, ie. to use as little dependencies as possible. I also need to have it working in Windows and Linux environments.

273K
  • 29,503
  • 10
  • 41
  • 64
stcr
  • 21
  • 2
  • Welcome to Stack Overflow. Please read [the help pages](http://stackoverflow.com/help), take the SO [tour], read [ask], as well as [this question checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – Some programmer dude Jul 21 '22 at 06:55
  • You'll have to implement OpenId/Oath2 for your client program in order to support 2 factor authentication. See https://developers.google.com/identity/protocols/oauth2/openid-connect You can use some existing lib for this https://github.com/zmartzone/liboauth2 – Victor Gubin Jul 21 '22 at 07:06
  • please edit your question and include [example] – Linda Lawton - DaImTo Jul 21 '22 at 10:12
  • Are you using apps password or are you using your regular password? – Giselle Valladares Jul 21 '22 at 16:08

1 Answers1

0

Go to your google account and create an apps password use that password in place of the password you currently have in your application.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449