Re: the great Gmail ERR [AUTH] thread

Charles Cazabon <[email protected]> Sat, 4 Jun 2022 08:52:00 -0600
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
Francesco Ariis <[email protected]> wrote:
> 
> I haven’t got a smartphone and if possible I would like not to buy one.

Me either.

> Would 2fa still work then?

Absolutely.  Time-based one-time passwords (TOTP) is a method where you take a
secret or token -- basically just some random bytes -- given to you by the
site.  You then run a tiny application on any electronic device - like, say,
the one you're using to access the service that wants you to authenticate, and
it shows a code that changes every 30s.

When they want to 2FA you, they ask you for the (typically 6-digit) code it's
currently showing.  No phone needed.

There are a million of these authenticator apps out there, because it's an
open, free standard.  Many apps are free, including Google's.  Any decent
password vault program can handle them.  I use a tiny, tiny script I wrote
myself, using the free pyotp library.  The code that actually does the work
is:

  secret = open(<filename>, "r").read().strip()
  totp = pyotp.TOTP(secret)
  code = totp.now()
  print(f"Current OTP: {code}")

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------