Socket
Socket
Sign inDemoInstall

cordova-plugin-android-fingerprint-auth

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-android-fingerprint-auth

Cordova plugin to use Android fingerprint authentication API


Version published
Weekly downloads
792
increased by5.18%
Maintainers
1
Weekly downloads
 
Created
Source

#About This plugin was created referencing the Fingerprint Dialog sample and the Confirm Credential sample referenced by the Android 6.0 APIs webpage.

This plugin will open a native dialog fragment prompting the user to authenticate using their fingerprint. If the device has a secure lockscreen (pattern, PIN, or password), the user may opt to authenticate using that method as a backup.

#Screenshots ###Fingerprint Auth Dialog Fingerprint Auth Dialog | Fingerprint Auth Dialog Success | Fingerprint Auth Dialog Fail | Fingerprint Auth Dialog Too Many | Fingerprint Auth Dialog No Backup | Fingerprint Auth Dialog No Backup ###Backup Credentials Confirm Password | Confirm PIN | Confirm Pattern

#Installation meteor add cordova:cordova-plugin-android-fingerprint-auth

#Setup Add preference to mobile-config.js

App.setPreference('android-targetSdkVersion', '23');

set compile version and build tools in build.gradle

compileSdkVersion 23
buildToolsVersion "23.0.2"

#API ###FingerprintAuth.show(config, successCallback, errorCallbck)

Opens a native dialog fragment to use the device hardware fingerprint scanner to authenticate against fingerprints registered for the device.

Config Object
ParamTypeDefaultDescription
clientIdStringundefined(REQUIRED) Used as the alias for your key in the Android Key Store.
clientSecretStringundefined(REQUIRED) Used to encrypt the token returned upon successful fingerprint authentication.
disableBackupbooleanfalseSet to true to remove the "USE BACKUP" button
maxAttemptsnumber5The device max is 5 attempts. Set this parameter if you want to allow fewer than 5 attempts.
localeString"en_US"Change the language. Available languages (English: "en_US", Spanish: "es"
userAuthRequiredbooleantrueRequire the user to authenticate with a fingerprint to authorize every use of the key. New fingerprint enrollment will invalidate key and require backup authenticate to re-enable the fingerprint authentication dialog.
dialogTitleStringundefinedSet the title of the fingerprint authentication dialog.
dialogMessageStringundefinedSet the message of the fingerprint authentication dialog.
dialogHintStringundefinedSet the hint displayed by the fingerprint icon on the fingerprint authentication dialog.
Example
FingerprintAuth.show({
            clientId: "myAppName",
            clientSecret: "a_very_secret_encryption_key"
        }, successCallback, errorCallback);

/**
 * @return {withFingerprint:base64EncodedString, withPassword:boolean}
 */
function successCallback(result) {
    console.log("successCallback(): " + JSON.stringify(result));
    if (result.withFingerprint) {
        console.log("Successfully authenticated using a fingerprint");
    } else if (result.withPassword) {
        console.log("Authenticated with backup password");
    }
}

function errorCallback(error) {
    console.log(error); // "Fingerprint authentication not available"
}

###FingerprintAuth.isAvailable(successCallback, errorCallback)

Example

FingerprintAuth.isAvailable(isAvailableSuccess, isAvailableError);

/**
 * @return {
 *      isAvailable:boolean,
 *      isHardwareDetected:boolean,
 *      hasEnrolledFingerprints:boolean
 *   }
 */
function isAvailableSuccess(result) {
    console.log("FingerprintAuth available: " + JSON.stringify(result));
    if (result.isAvailable) {
        FingerprintAuth.show({
                    clientId: "myAppName",
                    clientSecret: "a_very_secret_encryption_key"
                }, successCallback, errorCallback);
    }
}

function isAvailableError(message) {
    console.log("isAvailableError(): " + message);
}

Keywords

FAQs

Package last updated on 22 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc