Is there a Google Authenticator desktop client?

128

59

I am using Google Authenticator for 2-step authentication. I like how I can use a code and verify my account using my phone:

enter image description here

I realize that the app was designed to run on a device other than a computer to increase security for the computer (in case that it is lost or stolen), but I would like to know if there is a way I can run Google Authenticator on my Macbook.

Now, per the Google Authenticator Page it will not run on a desktop:

What devices does Google Authenticator work on?

  • Android version 2.1 or later
  • BlackBerry OS 4.5 - 6.0
  • iPhone iOS 3.1.3 or later

However there are several emulators for developers and so I wonder if it is possible to run one of these emulators and then run Google Authenticator with that. I do realize this is not a best practice - but I'm less worried about my laptop getting stolen and more worried about someone just hacking the account.

So my question is this: Is it possible to run it on the desktop, even though it is not meant to be / not recommended?

cwd

Posted 2012-08-16T16:24:33.243

Reputation: 13 508

nah, kind of defeats the purpose, if you think about it. but if you really want to defeat that purpose, this article explains how http://albertech.blogspot.com/2016/10/run-google-authenticator-from-your.html

– jar – 2016-10-18T22:45:54.537

however, as an alternative to GAuth under emulation you could just use oathplus - http://soundly.me/oathplus - it's essentially Google Authenticator for the command-line (I'm the dev).

– jar – 2016-11-11T04:18:34.240

By that same logic shouldn’t you avoid accessing all those websites that have enabled 2fa on your mobile (which is generally more likely to get stolen anyway)...? – user1073075 – 2019-01-06T16:15:50.980

This Firefox addon can also be explored. https://addons.mozilla.org/en-US/firefox/addon/auth-helper/ does this well.

– Animesh – 2020-01-11T06:35:48.070

Answers

101

Install oath-toolkit via brew, generate your keys with:

oathtool --totp -b <your_secret>

To get your secret, use the 'change phone' option in Google. You can get your key by clicking the 'manually enter the key' link.

martin

Posted 2012-08-16T16:24:33.243

Reputation: 1 034

Awesome! Only problem now - can't log in when I don't have my laptop. – Jason R. Coombs – 2016-09-01T16:08:16.580

13Copy the secret to a fairly secure file: (umask 0077;pbpaste > ~/.totp_google). Write a shell function to put the TOTP in your clipboard: totp() { oathtool --totp -b $(<~/".totp_${1:-google}") | pbcopy; }. Add other secrets for other services: (umask 0077;pbpaste > ~/.totp_github). Select which token you want from the function: totp github. Profit!!! – kojiro – 2016-10-13T00:11:47.370

1

FWIW I wrote a shell wrapper that does @kojiro 's suggestion: https://github.com/poolpog/bash-otp

– JDS – 2016-11-02T17:24:50.913

Here's a short shell script that reads the Google Authenticator app's database file and generates a live code for each key, providing you have enough access to your device to copy the file over to your PC. – Malvineous – 2017-10-01T09:15:06.447

1@JasonR.Coombs you should be able to login to both the laptop and your phone with the same secret key. Just did it right now and both generate the same 6 digit passcode. – John Lee – 2019-06-11T18:20:29.113

As a bash novice, I had to look up what the parenthesis did in the umask line by @kojiro. It's apparently called bash subshell. https://www.tldp.org/LDP/abs/html/subshells.html

– John Lee – 2019-06-12T16:37:19.627

27

There is a Self Hostable Web App at https://github.com/gbraad/html5-google-authenticator This is not secure on an internet facing machine, but you can load this on a completely offline Machine and you'd be safe.

Jharwood

Posted 2012-08-16T16:24:33.243

Reputation: 409

1

That's fantastic. You can use rawgit to run the app now or use a version pinned to a commit if you have concerns about the code mutating.

– Jason R. Coombs – 2016-09-01T16:24:42.683

1It looks really good - just makes me nervous b/c I don't easily understand everything that makes it work :) – cwd – 2013-05-25T00:30:20.057

4basically, it's using local storage inside your browser to store a secret key, local storage is only accessible from the domain it was written from (someone correct me if i'm wrong), it then uses the current time and the secret key from the local storage, to compute what the key should be. It's all just Javascript goodness – Jharwood – 2013-05-28T13:11:40.303

1This one is awesome bro. Now I don't need to run a VirtualBox or Bluestacks for this. – manish_s – 2014-03-24T16:41:06.383

19

JAuth is a good alternative - Java based (has Windows, Linux, and OS X installers), small and portable. I keep a copy on a USB drive.

cyberx86

Posted 2012-08-16T16:24:33.243

Reputation: 419

If JAuth_KS file is leaked can somebody else generate One Time Passwords for my accounts? – Saqib Ali – 2016-11-03T15:07:04.883

1I found the UI confusing. For me, on Linux Mint (Ubuntu based), the buttons were 3x3 px wide and hard to click, and what do they mean? The > button for example. + hard to see what's a button and what is some kind of title. — I wish they hadn't built any GUI at all, instead everything via the command line in Bash / Win CMD. I guess that would have saved them fairly much time too – KajMagnus – 2016-11-16T12:47:33.720

Can JAuth be configured for more than one account? – d-b – 2018-07-07T07:10:42.897

For my money, this ought to be the accepted answer. JAuth is works great, and has its own installer. It really couldn't be any easier. – evadeflow – 2014-04-11T13:37:48.457

17

Yes. You can use WinAuth. Works fine for me.

user626528

Posted 2012-08-16T16:24:33.243

Reputation: 783

Open source + very simple to use, and works even on Vista (which Authy does not do). – Casper – 2018-06-29T16:35:52.603

16

Try Authy: https://www.authy.com/.

It works for many 2fa accounts, including Google. Authy supports multiple platforms, including PC.

Note: Google seems to only provide a QR code for adding accounts. This means it's easiest to add your Google account via the Authy Android app. However, once you do that, you can also access it from the PC Authy app.

dss539

Posted 2012-08-16T16:24:33.243

Reputation: 281

1By far the best solution. It has a Chrome Extension too :) – Jacob Relkin – 2015-12-03T10:26:25.313

3Requires an online account. – pgampe – 2016-03-30T20:19:20.353

Just to be clear, this is a web app? And you have to upload your secrets to a third party? – jiggunjer – 2017-10-18T03:50:54.060

@jiggunjer good question. From their website "Data Security

Encrypt your 2FA data and backup to our cloud, without storing passwords with us." So yes and no. You can choose to let them hold your secrets but theoretically they can't access them. If I recall, you can skip the cloud backup feature if you wish. – dss539 – 2017-10-18T03:55:34.810

This requires a phone number. – SuperSandro2000 – 2019-10-06T13:31:42.580

12

Forget the others if you have to deal with more than one key, pass or any other kind of information. It is always a question how do you use it. The easiest method is to use an password management tool (please do not use online services for such things, LastPass has been hacked too).

Here is my suggestion (works on Linux, Mac, Android), this one is for Windows users:

  1. Download latest KeePass (currently 2.32) and set your DB up (please secure it with more than just an pass, an certificate makes it all more secure as example)
  2. Download TrayTOTP Plugin for KeePass and copy it into plugins folder located in KeePass installation folder.
  3. For an entry in KeePass, create two custom strings for your keepass entry:

    First string: TOTP Seed
    Second string: TOTP Settings

    Under TOTP Seed, you should place your seed key. For settings, many are confused, especially newbies. By default (and most use defaults) new key is always created every 30 seconds and has length of 6 characters. That means, if not explicitly set, then TOTP Settings should have:

    30;6
    

    30: Stands for seconds
    6: Stands for length of a key

    I know only couple services where you can choose or set it manually, Kraken Exchange is one of them, when you secure your account, you can choose length up to 8 characters and totp settings would be 30;8

  4. Change Autotype :) , there are two types of pages and how they verify.

    First: You can enter username, password and 2FA key.
    Second: You need to enter username and password, after pressing enter/submitting, second page/frame shows asking for 2FA.

    For first case, edit your KeePass entry by changing autotype options. Click on "Override default sequence" which is:

    {USERNAME}{TAB}{PASSWORD}{ENTER}
    

    and add pressing additional TAB, then placing TOTP key and then pressing ENTER:

    {USERNAME}{TAB}{PASSWORD}{TAB}{TOTP}{ENTER}
    

    For second case, we need to send user and pass, then wait 1-3 seconds (I will set here 5 seconds) and then 2FA key:

    {USERNAME}{TAB}{PASSWORD}{ENTER}{DELAY 5000}{TOTP}
    

That's it. Press CTRL+V or right click and perform autotype, that's it.

OhNo NotAgainMyPrivateData

Posted 2012-08-16T16:24:33.243

Reputation: 129

1KeePassXC is another version of KeePass that is cross platform and supports 2fa/OTP. Works well. – jeffmcneill – 2018-09-19T02:50:26.893

10

You could use Oracle's VirtualBox, Android x86 OS, and then install the Authenticator. This would essentially give you the Google Authenticator on a desktop.

VirtualBox: https://www.virtualbox.org/

Android x86: http://www.android-x86.org/

kobaltz

Posted 2012-08-16T16:24:33.243

Reputation: 14 361

7

There's also a Firefox OS app version. It doesn't need Firefox to run first, and you can actually install Firefox portable so it doesn't impact your system.

https://marketplace.firefox.com/app/gauth/

web

Posted 2012-08-16T16:24:33.243

Reputation: 71

has moved to: https://marketplace.firefox.com/app/gauth?src=search

– Joe – 2015-02-01T20:12:24.633

1Has moved again or is deleted. – nilsi – 2018-12-11T18:07:34.680

6

I hacked together an oath-toolkit integration with a CLI that works in Quicksilver too. The CLI Bash Script and .otpkeys Configuration File example can be found in the Quicksilver and OTP: Together At Last blog post.

You'll need your secret keys so you can put them into the config.

Bash Script:

#!/bin/bash
scriptname=`basename $0`
if [ -z $1 ]
then
    echo "$scriptname: Service Name Req'd"
    echo ""
    echo "Usage:"
    echo "   otp google"
    echo ""
    echo "Configuration: $HOME/.otpkeys"
    echo "Format: name=key"
    exit
fi
otpkey=` grep ^$1 $HOME/.otpkeys | cut -d"=" -f 2 | sed "s/ //g" `
if [ -z $otpkey ]
then
    echo "$scriptname: Bad Service Name"
    exit
fi
/usr/local/bin/oathtool --totp -b $otpkey

Configuration File example for .otpkeys -- spaces are stripped.

google=a743 mike k3b4 rm5k z8a9 q6f5 id1k bxk1
facebook=OWBV Q9LF POQ2 MKYU
evernote=UKPPIDEALLKPYTT9
dropbox=iop4 xbox asia b0ss ninj a9

Usage -- specify the full or partial service name from the config, anchored to the beginning of the service name. E.g. 'goo' will work for google, but 'oogl' will not.

iso : ~ --> otp google
196379
iso : ~ --> otp goo
612384

Peter Beckman

Posted 2012-08-16T16:24:33.243

Reputation: 61

5

Disclaimer: I'm the Author :-)

https://qoomon.github.io/otp-authenticator-webapp/

Its a google authenticator web app.

This is a static website hosted on github pages. You could just use my version or fork the gh-pages branch and hosted on your own github page.

No External Services are used, local JavaScript execution only

Features

  • generate totp codes
  • show remaining valid seconds for totp code
  • parse otpauth URLs in 'secret' input field
  • generate otpauth URL QR code
  • accept request parameters
    • secret
    • account
    • issuer

Here is an Example

qoomon

Posted 2012-08-16T16:24:33.243

Reputation: 181

5

On MAC (OSX) you can use Alfred* and the GAuth-Workflow to get the Google Authenticator on your Desktop.

  • Workflows are only supported with the (paid) Powerpack version.

Sascha

Posted 2012-08-16T16:24:33.243

Reputation: 160

Sascha, Have you been able to find a more native app for Mac OS to generate the Google Tokens? – Saqib Ali – 2016-11-03T18:49:40.487

4

I'm surprised that no one mentions the following 2 apps.

Authenticator - Happy Two-Factor Verifying! / $2.99

OTP Manager / Free

user181734

Posted 2012-08-16T16:24:33.243

Reputation:

Authenticator price is $3.49 for me. And author's GitHub page is not there anymore. – Denis The Menace – 2018-12-02T11:04:39.243

2

YubiKey offers a hardware solution (an USB dongle) that's capable of doing OATH-TOTP.

There's also a Windows helper program:

http://www.yubico.com/applications/internet-services/gmail/

ce4

Posted 2012-08-16T16:24:33.243

Reputation: 923

0

Dan Jones

Posted 2012-08-16T16:24:33.243

Reputation: 129

This appears to be a better reviewed chrome extension – Brad Parks – 2017-05-08T12:49:45.427

0

You can use my script: otp.py

The downside of it is that:

  1. you'll see a proper countdown only when the first code expires :)
  2. this zenity popup doesn't allow copy & paste (this is a big limitation IMO)
  3. it was working on Mac, but Cocoa Dialog was retired and it doesn't work anymore.
  4. perhaps it can be adapted to work on Windows, by installing Zenity on Windows (which is possible).

maxadamo

Posted 2012-08-16T16:24:33.243

Reputation: 103

0

I'm just getting up to speed with this myself, but it appears that there is now a google-authenticator command-line interface that's distributed with the PAM module at https://github.com/google/google-authenticator-libpam.

Some further information on setup (aimed at use with ssh on CentOS) can be found in an article at https://www.digitalocean.com/community/tutorials/how-to-set-up-multi-factor-authentication-for-ssh-on-centos-7.

James

Posted 2012-08-16T16:24:33.243

Reputation: 1

0

There is an open-source authenticator implementation: https://github.com/Authenticator-Extension/Authenticator.

pjpj

Posted 2012-08-16T16:24:33.243

Reputation: 101

0

Open-sourced keeweb has OTP option built-in, on top of the password manager + autogen pass. Works on MacOSX and as a WebApp

https://github.com/keeweb/keeweb

Jimmy M.G. Lim

Posted 2012-08-16T16:24:33.243

Reputation: 111

0

For Python user, there is a little tool called mfa available through PyPI. Just install it using pip install mfa.

https://github.com/limeburst/mfa

onelaview

Posted 2012-08-16T16:24:33.243

Reputation: 111

-1

If you wrote down the seed for your sites and have Python (easy to install on Mac/Windows/linux), you can use this command line script, which also tries to hide the seed from inadvertent bad use: twisted2sv.

circulosmeos

Posted 2012-08-16T16:24:33.243

Reputation: 101

-1

Use this Python simple script to get authentication code all you have to do is add your secret when prompt.

https://github.com/abhishek-bharadwaj/Authenticator/blob/master/Authenticator.py

Abhishek

Posted 2012-08-16T16:24:33.243

Reputation: 99