Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit

Bazel CI is updating to build-tools 30.x.x. This allows for more flexibility with changing Bazel CI SDK versions.


Git stats


Failed to load latest commit information.

Google Authenticator for Android (Open Source Version)

This project is an open source fork of the Google Authenticator Android app on the Play Store. While this fork is open source, the official version of the app still remains proprietary. There is no guarantee that the open source repository will receive any changes made upstream (or vice versa).

Google Authenticator generates 2-Step Verification codes on your phone.

2-Step Verification provides stronger security for your Google Account by requiring a second step of verification when you sign in. In addition to your password, you’ll also need a code generated by the Google Authenticator app on your phone.

Learn more about 2-Step Verification:


  • Generate verification codes without a data connection
  • Google Authenticator works with many providers & accounts
  • Dark theme available
  • Automatic setup via QR code

Disclaimer: This open source fork of Authenticator is not an officially supported Google product.


The Google Authenticator project includes implementations of one-time passcode generators for several mobile platforms, as well as a Pluggable Authentication Module (PAM). One-time passcodes are generated using open standards developed by the Initiative for Open Authentication (OATH) (which is unrelated to OAuth).

  • This project contains the Android app. All other apps and the PAM module are hosted in separate projects.

  • The Android implementation supports the HMAC-Based One-time Password (HOTP) algorithm specified in RFC 4226 and the Time-based One-time Password (TOTP) algorithm specified in RFC 6238.

  • By design, there are no account backups in any of the apps.

Further documentation is available in the Wiki.


The APKs for the official version and the open source version of Authenticator are hosted separately. Installing the app should be as simple as downloading the APK from your desired source.

Official Google Build

You can install the official (proprietary) version of Google Authenticator from the Google Play Store.

Open Source Version

The easiest way to install the open source flavor of Authenticator is to download the latest version of the APK from the releases page from the GitHub repository. To build the APK from the source code, see the section about building from source.

Developer Guide

Interested in developing with Authenticator? Instructions to get started are below. Please be sure to review the Contributor Guide and the Code of Conduct if you would like to contribute to this repository.


Google Authenticator is built with Bazel. To install Bazel on your machine, follow the installation instructions provided in the official Bazel documentation. You can download the appropriate versions of the Android SDK and Build Tools via the Android SDK Manager.

Building from Source

  1. Clone the repository.

    git clone
    cd google-authenticator-android
  2. Set the ANDROID_HOME environment variable to the path of your Android SDK, or hardcode the value into the WORKSPACE file.

    export ANDROID_HOME="/path/to/sdk"
    # or
  3. Build the APK with Bazel. The APK build target is at //java/com/google/android/apps/authenticator. If you already have an emulator running or device attached to your machine, you can use the mobile-install Bazel directive to put the app directly on your Android device. Otherwise, build the APK normally and install it on your device via adb.

    bazel mobile-install //java/com/google/android/apps/authenticator
    # or
    bazel build //java/com/google/android/apps/authenticator \
      && adb install -r -d bazel-bin/java/com/google/android/apps/authenticator/authenticator.apk

Running Tests

Running the tests for Authenticator requires additional prerequisites described in the android_instrumentation_test documentation. Most notably, at the moment, tests can only be run on Linux. There is an open tracking issue for adding test support to other operating systems. Please file Bazel-related issues against the Bazel repository instead of this repository.

Running tests also requires the appropriate Android emulator images to be installed (depending on the specific test target). You can download any necessary images from the AVD Manager.

Test Targets

All test targets can be found under the javatests/ directory.

bazel test //javatests/...

Test Configs

By default, all tests will be run on a headless emulator. To see the Android device running the test, or to run tests on a specific device or emulator, specify the value of the config flag in the Bazel test command to be one of headless, gui, or local_device.

# Run headless tests (default)
bazel test --config=headless //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19

# Run tests on an ephemeral emulator that displays the GUI
bazel test --config=gui //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19

# Run tests on an emulator or attached device
bazel test --config=local_device //javatests/com/google/android/apps/authenticator:authenticator_instrumentation_tests-19

WARNING: Running tests on a real device may delete your preexisting OTP seeds. Do it at your own risk. If you must run tests on a real device, it is recommended to use a test device that doesn't hold important data.


Copyright 2019 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.