scintill / DuOTP-android

small GPL3+ Android app that allows you to log in to some Duo-protected services with a standard OTP app
https://f-droid.org/en/packages/net.scintill.duotp/
GNU General Public License v3.0
16 stars 3 forks source link
android duo otp

DuOTP

DuOTP is a small GPL3+ Android app that allows you to log in to Duo*-protected services with a standard OTP app, such as Google Authenticator.

DuOTP has no visible interface or app drawer icon. An OTP-capable app must also be installed (Google Authenticator or similar.) See below for usage instructions.

Usage

(Disclaimer: I don't know how much of this could vary between sites, so I can only describe how the one I tested with works.)

  1. Get your Android device with DuOTP installed and enter incognito mode. (Incognito so that any previous login sessions are ignored.) Begin logging into the protected service on your Android device.
  2. When you get to the Duo login screen, choose Add a new device and authenticate if needed.
  3. Choose to activate a Tablet, then choose Android.
  4. Click I have Duo Mobile installed, then Take me to Duo Mobile.
  5. Your OTP app should then open, asking to confirm importing the secret token. If an error occurs, DuOTP will pop up an error message. If nothing happens, then DuOTP is not installed correctly, or your browser is not activating it.
  6. After you have saved the account in your OTP app, return to the browser. Tap Continue and Continue to Login. Now and any future time you are prompted by the Duo login screen, choose Enter a Passcode and copy the numeric code from your OTP app.

After this, you don't need to use DuOTP again, and may remove it from your device if you'd like. (It's small though, so it might be worth keeping around in case Duo expires the secret token.)

Tested with

Some technical details

This app is activated by tapping a link with sceheme duo:// from a Duo-enabled web page. DuOTP then loads the HOTP token from a Duo URL and passes it to your OTP app (any app supporting the otpauth:// scheme.) Most of this logic is in the ActivationStringImporter class.

Possible future enhancements and open questions

License

Copyright 2019 Joey Hewitt <joey@joeyhewitt.com>

DuOTP is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

DuOTP is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

The full GPLv3 license text is included in the file COPYING.

A file under Apache License Version 2.0 is included in app/src/main/java/com/google/android/apps/authenticator/util/Base32String.java.

* Note: this app is not associated with or endorsed by Duo Security, Inc. or Cisco Systems, Inc.

Thanks to https://github.com/simonseo/nyuad-spammer/blob/master/spammer/duo/duo.py for giving some hints about the enrollment process.