simple interface to verify user authenticity

Overview

React Native Simple Biometrics

npm

A simple and straight forward API to ask a user to authenticate with on device biometrics. This can be used to quickly verify if the app is being used by the owner of the phone (or a trustee) before showing some sensitive info.

demo

Getting started

$ yarn add react-native-simple-biometrics

minimum versions

  • iOS target: 8.0
  • Android minSdkVersion: 21

iOS permission

It is required to add an entry in your ios app's info.plist giving a valid reason to use the phones face ID system.

<key>NSFaceIDUsageDescription</key>
<string>a valid reason to use biometrics</string>

Calling the authenticate function will automatically ask iOS users for the permission. For more control over when to ask permissions, use react-native-permissions

Usage

Only 2 methods are exposed

  • canAuthenticate()
  • requestBioAuth(promptTitle: string, promptMessage: string)
import RNBiometrics from "react-native-simple-biometrics";

// this will be false if
// - no biometrics hardware
// - permission was denied for face ID (iOS only)
const can = await RNBiometrics.canAuthenticate();

if (can) {
  try {
    await RNBiometrics.requestBioAuth("prompt-title", "prompt-message");
    // stuff to do when authenticated
    // ...
  } catch (error) {
    // stuff to do when auth failed
    // ...
  }
}

credits

react-native-biometrics is a super-set of this library. For more features like keys generation, signatures, etc use react-native-biometrics.

Comments
  • canAuthenticate return false everytime

    canAuthenticate return false everytime

    Hello. i am trying to implement biometric for my application. i am always getting false in canAuthenticate.

    My Device is Google Pixel 1 - Android Version 10

    opened by ydv0121 3
  • feat: add support for react-native@0.68

    feat: add support for [email protected]

    I am not android native developer and This PR is a product of trial and error method. I probably need to update the example app too, however, the example app in the current version is able to create successful builds.

    closes #10

    opened by ArnabXD 1
  • Plugin with id 'maven' not found

    Plugin with id 'maven' not found

    Android build is failing with 2 errors: Plugin with id 'maven' not found: I believe this is because the maven plugin is removed from Gradle. compileSdkVersion is not specified.

    This is with React Native 0.68.0

    opened by aalshberi 1
  • For IOS canAuthenticate method returns false if Face ID is removed while passcode is still enrolled

    For IOS canAuthenticate method returns false if Face ID is removed while passcode is still enrolled

    Incase user deletes Face ID data from the IPhone while passcode is still enrolled in that case library's method canAuthenticate should return true because user can still enter passcode and make authentication successful. but as it returns false it so library doesn't ask for the authentication

    opened by asadbaig2021 1
  • react 17 support in peerDeependencies and devDependencies (fix for issue #6)

    react 17 support in peerDeependencies and devDependencies (fix for issue #6)

    Fixing an error (issue #6) that happens when trying to install react-native-simple-biometrics in a new React Native project that support React 17.

    The fix has been tested and it works flawlessly.

    opened by ramuta 1
  • React v17 vs. v16.8 dependency clash

    React v17 vs. v16.8 dependency clash

    I got this error when trying to install the library:

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/react
    npm ERR!   react@"17.0.1" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"^16.8.1" from [email protected]
    npm ERR! node_modules/react-native-simple-biometrics
    npm ERR!   react-native-simple-biometrics@"*" from the root project
    npm ERR! 
    npm ERR! Fix the upstream dependency conflict, or retry
    npm ERR! this command with --force, or --legacy-peer-deps
    npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
    

    I see that react is a peer&dev dependency in the library. Should I wait for you to upgrade from v16.8 to v17, or do you suggest something else?

    Could you set react dependency to "*" or at least add || ^17.0.0" next to the v16?

    opened by ramuta 1
  • Entering PIN number doesn't work - is this intended?

    Entering PIN number doesn't work - is this intended?

    When a fingerprint prompt shows up and user chooses to enter a PIN number instead of a fingerprint, nothing happens (even if the PIN is correct). The requestBioAuth() function does not return anything, not even false...

    Is this intended behaviour?

    opened by ramuta 12
  • Option to disable Pin/Pattern

    Option to disable Pin/Pattern

    is there any possibility to hide the 'UsePin/UsePattern' form the prompt in android

    Originally posted by @ndileep-dev in https://github.com/smallcase/react-native-simple-biometrics/issues/3#issuecomment-871886727

    enhancement 
    opened by LonelyCpp 2
Releases(v1.5.0)
  • v1.5.0(Jul 18, 2022)

    What's Changed

    • update to support new architecture by @LonelyCpp
    • update to use typescript by @LonelyCpp
    • update example app to v0.69.2 by @LonelyCpp

    Full Changelog: https://github.com/smallcase/react-native-simple-biometrics/compare/v1.4.1...v1.5.0

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0-alpha.2(Jul 16, 2022)

    What's Changed

    • feat: add support for [email protected] by @ArnabXD in https://github.com/smallcase/react-native-simple-biometrics/pull/11
    • update example app to RN-69 by @LonelyCpp
    • add type declaration file by @LonelyCpp

    New Contributors

    • @ArnabXD made their first contribution in https://github.com/smallcase/react-native-simple-biometrics/pull/11

    Full Changelog: https://github.com/smallcase/react-native-simple-biometrics/compare/v1.5.0-alpha.1...v1.5.0-alpha.2

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0-alpha.1(Jan 3, 2022)

  • 1.5.0-alpha.0(Jul 27, 2021)

  • v1.4.1(Jul 17, 2021)

  • v1.4.0(Jun 7, 2021)

  • v1.3.0(Feb 26, 2021)

  • 1.2.1(Feb 26, 2021)

JNDI-Exploit is an exploit on Java Naming and Directory Interface (JNDI) from the deleted project fromthe user feihong on GitHub.

JNDI-Exploit JNDI-Exploit is a fork from the deleted project ftom the user feihong-cs on GitHub. To learn more about JNDI and what you can do with thi

Nil MALHOMME 4 Dec 6, 2022
Password4j is a user-friendly cryptographic library that supports Argon2, Bcrypt, Scrypt, PBKDF2 and various cryptographic hash functions.

Password4j is a Java user-friendly cryptographic library for hashing and checking passwords with different Key derivation functions (KDFs) and Cryptog

Password4J 246 Jan 5, 2023
A Vaadin example application that use Firebase Authentication as its user database

Vaadin + Firebase Auth example A trivial example to use Firebase Authentication with a Vaadin application. The app is built based on start.vaadin.com

Matti Tahvonen 3 Mar 9, 2022
A simple HWID authentication system for your minecraft mod.

HWID-Authentication-System A simple HWID authentication system for your minecraft mod. This is a simple mod which can prevent unwanted users from runn

null 43 Dec 10, 2022
A simple HWID authentication system for your minecraft mod.

HWID-Authentication-System A simple HWID authentication system for your minecraft mod. This is a simple mod which can prevent unwanted users from runn

null 43 Dec 10, 2022
Simple Hospital Managers Project GUI Java

Hospital-Managers-GUI-Java Simple Hospital Managers Project GUI Java To Run Code You just need to run MainClass.java in any IDE I make a YouTube Video

Ali Abdollahian Noghabi 2 Feb 4, 2022
Forest_tracker - Help protect the environment with such a simple app.

Forest Tracker ?? ?? ?? Introduction Hey there! This app is all about protecting the environment! A unique method. Deforestation is happening at an al

Forest Tracker 2 May 11, 2022
Simple API for using Java Reflection

Reflector По поводу багов или идей для данного репозитория можно писать в Discord или ВК(обратная связь) Обратная связь Discord: UnLegit#6190 ВКонтакт

null 1 Jan 25, 2022
Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

AdoptOpenJDK 2.8k Jan 3, 2023
Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.

JITWatch Log analyser and visualiser for the HotSpot JIT compiler. Video introduction to JITWatch video Slides from my LJC lightning talk on JITWatch

AdoptOpenJDK 2.8k Jan 3, 2023
A Java user-interface library with support for Minecraft.

interfaces Building interfaces since 2021. interfaces is a builder-style user interface library designed to make creation of flexible user interfaces

Incendo 54 Dec 24, 2022
Calculator with terminal-based user interface

Calculator-TUI Calculator with terminal-based user interface (My first Java project) Dependencies -Windows- JDK: https://download.oracle.com/java/17/l

Dr. Bruh 2 Apr 30, 2022
AES block cipher modes with user interface.

AES Ciphers An implementation of The common AES block cipher modes of operations (ECB, CBC, CTR), with user interface. It allows you to encrypt and de

Abd El-Twab M. Fakhry 6 Nov 21, 2022
Sui - Modern super user interface implementation on Android.

Sui Modern super user interface (SUI) implementation on Android. The name, Sui, also comes from a character. Introduction Sui provides Java APIs, Shiz

Rikka apps 1k Jan 5, 2023
JNDI-Exploit is an exploit on Java Naming and Directory Interface (JNDI) from the deleted project fromthe user feihong on GitHub.

JNDI-Exploit JNDI-Exploit is a fork from the deleted project ftom the user feihong-cs on GitHub. To learn more about JNDI and what you can do with thi

Nil MALHOMME 4 Dec 6, 2022
Traditional roguelike game with pixel-art graphics and simple interface

Traditional roguelike game with pixel-art graphics and simple interface

Evan Debenham 2.5k Dec 30, 2022
The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types.

Apache Commons CSV The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types. Documentation More i

The Apache Software Foundation 307 Dec 26, 2022
The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries

The Download Manager uses a simple yet effective GUI interface built with java’s Swing libraries.The use of Swing gives the interface a crisp, modern look and feel. The GUI maintains a list of downloads that are currently being managed.

Manish Kumar Mahawar 2 Jan 2, 2022
A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

A simple Plugin to allow server admins and user with Permissions to change fast and easy thier own Gamemode

Qubik Studios 1 Jan 17, 2022