NativeScript / NativeScript/plugins

[@nativescript/biometrics] - Android: ".pinFallBack: false" returns javax exception

Open
#338 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

General Info:

Android minSdk: 26
Android Emulator Sdk: 33
Plugin Version in package.json: ^1.3.1


JS Code in main-page.js
const biometricAuthPlugin = require('@nativescript/biometrics');
const biometrics = new biometricAuthPlugin.BiometricAuth();

biometrics.verifyBiometric({
                title: 'Speichern der Anmeldedaten',
                message: 'Anmeldedaten werden gespeichert bzw. überschrieben und in Zukunft zur schnelleren Anmeldung automatisch ausgefüllt.',
                fallbackMessage: 'Bitte PIN eingeben',
                pinFallback: false,
            }).then(function (result) {
                if (result.code === 0 || result.message === "All OK") {
                    AppSettings.setString("username", eventData.username);
                    AppSettings.setString("password", eventData.password);
                } else {
                    console.warn("Sonderfall Authentifizierung (erfolgreich aber nicht Code 0):", result);
                }
            }).catch(function (error) {
                if (error.code === 50 || error.message === "Authentication canceled") {
                    console.log("Authentifizierung durch Nutzer abgebrochen");
                } else {
                    console.warn("Fehlerfall bei der Authentifizierung:", error);
                }
            });

This is inside a function which responds to an Event in a WebView. eventData is provided by this function. This function is not the source of the problem, it always worked.


Steps:
  1. Start Auth. process
  2. Android Window Pops up
  3. Touch Fingerprint Sensor, Android confirms Fingerprint
  4. Error in onAuthenticationSucceeded: Error: javax.crypto.IllegalBlockSizeException

Might this be a problem of my installed Java-Version?
I checked that the usage of ü, ö, ä is not the Problem (Why ever this should be a problem, UTF-8 supports umlauts/mutations after all)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the @nativescript/biometrics Android implementation and the verifyBiometric path, reproducing the listed steps with pinFallback set to false. Inspect the onAuthenticationSucceeded failure involving javax.crypto.IllegalBlockSizeException; done means successful fingerprint authentication no longer produces that exception in this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, typescript
Domain
authentication, mobile, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.