@capgo/capacitor-native-biometric 8.0.5 → 8.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -6
- package/android/src/main/java/ee/forgr/biometric/AuthActivity.java +6 -0
- package/android/src/main/java/ee/forgr/biometric/NativeBiometric.java +7 -0
- package/dist/docs.json +6 -0
- package/dist/esm/definitions.d.ts +2 -1
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +6 -0
- package/dist/esm/web.js +38 -17
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +40 -17
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +40 -17
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativeBiometricPlugin/NativeBiometricPlugin.swift +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Use biometrics confirm device owner presence or authenticate users. A couple of
|
|
|
13
13
|
|
|
14
14
|
A **free**, **comprehensive** biometric authentication plugin with secure credential storage:
|
|
15
15
|
|
|
16
|
-
- **All biometric types** - Face ID, Touch ID, Fingerprint, Face Authentication, Iris
|
|
16
|
+
- **All biometric types** - Face ID, Touch ID, Fingerprint, Face Authentication, Iris, and Device Credentials (PIN, pattern, password)
|
|
17
17
|
- **Secure credential storage** - Keychain (iOS) and Keystore (Android) integration
|
|
18
18
|
- **Flexible fallback** - Optional passcode fallback when biometrics unavailable
|
|
19
19
|
- **Customizable UI** - Full control over prompts, titles, descriptions, button text
|
|
@@ -27,12 +27,106 @@ Perfect for banking apps, password managers, authentication flows, and any app r
|
|
|
27
27
|
|
|
28
28
|
The most complete doc is available here: https://capgo.app/docs/plugins/native-biometric/
|
|
29
29
|
|
|
30
|
+
## ⚠️ Security Considerations
|
|
31
|
+
|
|
32
|
+
### Important: verifyIdentity() Can Be Bypassed on Rooted/Jailbroken Devices
|
|
33
|
+
|
|
34
|
+
The `verifyIdentity()` method **should not be used as the sole authentication mechanism** for sensitive operations. On rooted Android devices or jailbroken iOS devices, attackers can use tools like Frida, Xposed, or similar frameworks to:
|
|
35
|
+
|
|
36
|
+
- Hook the JavaScript bridge and force `verifyIdentity()` to return success
|
|
37
|
+
- Intercept native method calls and bypass biometric authentication
|
|
38
|
+
- Modify the app's runtime behavior to skip authentication checks
|
|
39
|
+
|
|
40
|
+
### Recommended Security Practices
|
|
41
|
+
|
|
42
|
+
1. **Use Root/Jailbreak Detection**: Protect your app by detecting compromised devices. We recommend using the **[@capgo/capacitor-is-root](https://github.com/Cap-go/capacitor-is-root)** plugin to detect rooted/jailbroken devices:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { IsRoot } from '@capgo/capacitor-is-root';
|
|
46
|
+
|
|
47
|
+
async function checkDeviceSecurity() {
|
|
48
|
+
const { result } = await IsRoot.isRooted();
|
|
49
|
+
|
|
50
|
+
if (result) {
|
|
51
|
+
// Handle rooted device - show warning, restrict features, or block access
|
|
52
|
+
console.warn('Device security compromised');
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. **Never Store Sensitive Data Client-Side**: Don't rely on locally stored credentials for critical authentication. Use `verifyIdentity()` as a convenience feature, not a security boundary.
|
|
60
|
+
|
|
61
|
+
3. **Server-Side Verification**: Always validate authentication on your backend server. Biometric authentication should be used for user convenience, with the real authentication happening server-side.
|
|
62
|
+
|
|
63
|
+
4. **Implement Additional Security Layers**:
|
|
64
|
+
- Use certificate pinning for API calls
|
|
65
|
+
- Implement server-side session management
|
|
66
|
+
- Use short-lived tokens that expire after biometric auth
|
|
67
|
+
- Add anti-tampering checks
|
|
68
|
+
|
|
69
|
+
### Secure Usage Pattern
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { NativeBiometric } from "@capgo/capacitor-native-biometric";
|
|
73
|
+
import { IsRoot } from '@capgo/capacitor-is-root';
|
|
74
|
+
|
|
75
|
+
async function secureAuthentication() {
|
|
76
|
+
// 1. Check device security first
|
|
77
|
+
const { result } = await IsRoot.isRooted();
|
|
78
|
+
if (result) {
|
|
79
|
+
// Handle rooted device appropriately
|
|
80
|
+
// Example: showSecurityWarning() could display an alert to the user
|
|
81
|
+
showSecurityWarning();
|
|
82
|
+
// Optionally: disable biometric login, require re-authentication, etc.
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// 2. Perform biometric authentication
|
|
86
|
+
try {
|
|
87
|
+
await NativeBiometric.verifyIdentity({
|
|
88
|
+
reason: "Authenticate to access your account",
|
|
89
|
+
title: "Biometric Login",
|
|
90
|
+
});
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.error("Biometric authentication failed");
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// 3. Get stored credentials (if needed for convenience)
|
|
97
|
+
const credentials = await NativeBiometric.getCredentials({
|
|
98
|
+
server: "www.example.com",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// 4. CRITICAL: Validate credentials with your backend server
|
|
102
|
+
// Example: validateWithServer() should send credentials to your API
|
|
103
|
+
// and verify them server-side before granting access
|
|
104
|
+
const isValid = await validateWithServer(credentials.username, credentials.password);
|
|
105
|
+
|
|
106
|
+
return isValid;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### What This Plugin Provides
|
|
111
|
+
|
|
112
|
+
This plugin provides:
|
|
113
|
+
- ✅ Convenient local biometric authentication UI
|
|
114
|
+
- ✅ Secure credential storage using Keychain (iOS) and Keystore (Android)
|
|
115
|
+
- ✅ Protection against casual unauthorized access
|
|
116
|
+
|
|
117
|
+
This plugin does NOT provide:
|
|
118
|
+
- ❌ Protection against determined attackers on compromised devices
|
|
119
|
+
- ❌ Server-side authentication or validation
|
|
120
|
+
- ❌ Root/jailbreak detection (use [@capgo/capacitor-is-root](https://github.com/Cap-go/capacitor-is-root))
|
|
121
|
+
|
|
30
122
|
## Installation (Only supports Capacitor 7)
|
|
31
123
|
|
|
32
124
|
- `npm i @capgo/capacitor-native-biometric`
|
|
33
125
|
|
|
34
126
|
## Usage
|
|
35
127
|
|
|
128
|
+
⚠️ **Important**: Before implementing biometric authentication, review the [Security Considerations](#️-security-considerations) section to understand limitations and best practices for secure implementation.
|
|
129
|
+
|
|
36
130
|
```ts
|
|
37
131
|
import { NativeBiometric, BiometryType } from "@capgo/capacitor-native-biometric";
|
|
38
132
|
|
|
@@ -65,6 +159,9 @@ async performBiometricVerification(){
|
|
|
65
159
|
const credentials = await NativeBiometric.getCredentials({
|
|
66
160
|
server: "www.example.com",
|
|
67
161
|
});
|
|
162
|
+
|
|
163
|
+
// IMPORTANT: Always validate credentials with your backend server
|
|
164
|
+
// Do not trust client-side verification alone
|
|
68
165
|
}
|
|
69
166
|
|
|
70
167
|
// Save user's credentials
|
|
@@ -74,6 +171,12 @@ NativeBiometric.setCredentials({
|
|
|
74
171
|
server: "www.example.com",
|
|
75
172
|
}).then();
|
|
76
173
|
|
|
174
|
+
// Check if credentials are already saved
|
|
175
|
+
const isSaved = await NativeBiometric.isCredentialsSaved({
|
|
176
|
+
server: "www.example.com",
|
|
177
|
+
});
|
|
178
|
+
console.log('Credentials saved:', isSaved.isSaved);
|
|
179
|
+
|
|
77
180
|
// Delete user's credentials
|
|
78
181
|
NativeBiometric.deleteCredentials({
|
|
79
182
|
server: "www.example.com",
|
|
@@ -89,6 +192,47 @@ const handle = await NativeBiometric.addListener('biometryChange', (result) => {
|
|
|
89
192
|
// await handle.remove();
|
|
90
193
|
```
|
|
91
194
|
|
|
195
|
+
### Complete Login Flow Example
|
|
196
|
+
|
|
197
|
+
This example shows how to use `isCredentialsSaved()` to check if credentials are already saved before showing a "save credentials" popup:
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
// After successful login
|
|
201
|
+
async handleLoginSuccess(username: string, password: string) {
|
|
202
|
+
// Check if biometric authentication is available
|
|
203
|
+
const result = await NativeBiometric.isAvailable({ useFallback: true });
|
|
204
|
+
|
|
205
|
+
if (!result.isAvailable) {
|
|
206
|
+
// Biometrics not available - go to home page directly
|
|
207
|
+
this.navigateToHome();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// Check if credentials are already saved
|
|
212
|
+
const checkCredentials = await NativeBiometric.isCredentialsSaved({
|
|
213
|
+
server: "www.example.com"
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
if (checkCredentials.isSaved) {
|
|
217
|
+
// Credentials already saved - go to home page
|
|
218
|
+
this.navigateToHome();
|
|
219
|
+
} else {
|
|
220
|
+
// No credentials saved - show save credentials popup
|
|
221
|
+
this.showSaveCredentialsPopup(username, password);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Save credentials when user confirms
|
|
226
|
+
async saveCredentials(username: string, password: string) {
|
|
227
|
+
await NativeBiometric.setCredentials({
|
|
228
|
+
username: username,
|
|
229
|
+
password: password,
|
|
230
|
+
server: "www.example.com",
|
|
231
|
+
});
|
|
232
|
+
this.navigateToHome();
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
92
236
|
### Biometric Auth Errors
|
|
93
237
|
|
|
94
238
|
This is a plugin specific list of error codes that can be thrown on verifyIdentity failure, or set as a part of isAvailable. It consolidates Android and iOS specific Authentication Error codes into one combined error list.
|
|
@@ -397,6 +541,7 @@ Callback type for biometry change listener
|
|
|
397
541
|
| **`FACE_AUTHENTICATION`** | <code>4</code> |
|
|
398
542
|
| **`IRIS_AUTHENTICATION`** | <code>5</code> |
|
|
399
543
|
| **`MULTIPLE`** | <code>6</code> |
|
|
544
|
+
| **`DEVICE_CREDENTIAL`** | <code>7</code> |
|
|
400
545
|
|
|
401
546
|
|
|
402
547
|
#### BiometricAuthError
|
|
@@ -445,13 +590,13 @@ The `biometryType` field indicates what biometric hardware is present, but **har
|
|
|
445
590
|
|
|
446
591
|
## Web Platform
|
|
447
592
|
|
|
448
|
-
This plugin
|
|
449
|
-
- `isAvailable()` returns `{ isAvailable:
|
|
593
|
+
This plugin provides a dummy implementation for in-browser development and testing. On web:
|
|
594
|
+
- `isAvailable()` returns `{ isAvailable: true, ... }` simulating biometric availability
|
|
450
595
|
- `addListener()` returns a no-op handle
|
|
451
|
-
- `verifyIdentity()`
|
|
452
|
-
- Credential methods
|
|
596
|
+
- `verifyIdentity()` always succeeds (no actual authentication)
|
|
597
|
+
- Credential methods use in-memory storage (credentials stored in a Map, cleared on page refresh)
|
|
453
598
|
|
|
454
|
-
This allows you to
|
|
599
|
+
This allows you to develop and test your app in the browser without errors. Note that real biometric authentication is only available on iOS and Android platforms.
|
|
455
600
|
|
|
456
601
|
## Contributors
|
|
457
602
|
|
|
@@ -168,6 +168,12 @@ public class AuthActivity extends AppCompatActivity {
|
|
|
168
168
|
case 5: // IRIS_AUTHENTICATION
|
|
169
169
|
authenticators |= BiometricManager.Authenticators.BIOMETRIC_STRONG;
|
|
170
170
|
break;
|
|
171
|
+
case 6: // MULTIPLE - allow all biometric types
|
|
172
|
+
authenticators |= BiometricManager.Authenticators.BIOMETRIC_STRONG;
|
|
173
|
+
break;
|
|
174
|
+
case 7: // DEVICE_CREDENTIAL (PIN, pattern, or password)
|
|
175
|
+
authenticators |= BiometricManager.Authenticators.DEVICE_CREDENTIAL;
|
|
176
|
+
break;
|
|
171
177
|
}
|
|
172
178
|
}
|
|
173
179
|
return authenticators > 0 ? authenticators : BiometricManager.Authenticators.BIOMETRIC_STRONG;
|
|
@@ -61,6 +61,7 @@ public class NativeBiometric extends Plugin {
|
|
|
61
61
|
private static final int FACE_AUTHENTICATION = 4;
|
|
62
62
|
private static final int IRIS_AUTHENTICATION = 5;
|
|
63
63
|
private static final int MULTIPLE = 6;
|
|
64
|
+
private static final int DEVICE_CREDENTIAL = 7;
|
|
64
65
|
|
|
65
66
|
// AuthenticationStrength enum values
|
|
66
67
|
private static final int AUTH_STRENGTH_NONE = 0;
|
|
@@ -188,6 +189,12 @@ public class NativeBiometric extends Plugin {
|
|
|
188
189
|
return IRIS_AUTHENTICATION;
|
|
189
190
|
}
|
|
190
191
|
|
|
192
|
+
// If no biometric sensors are available but device has credentials (PIN/pattern/password)
|
|
193
|
+
// return DEVICE_CREDENTIAL type
|
|
194
|
+
if (this.deviceHasCredentials()) {
|
|
195
|
+
return DEVICE_CREDENTIAL;
|
|
196
|
+
}
|
|
197
|
+
|
|
191
198
|
return NONE;
|
|
192
199
|
}
|
|
193
200
|
|
package/dist/docs.json
CHANGED
package/dist/esm/definitions.js
CHANGED
|
@@ -14,6 +14,8 @@ export var BiometryType;
|
|
|
14
14
|
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
|
|
15
15
|
// Android
|
|
16
16
|
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
|
|
17
|
+
// Android - Device credentials (PIN, pattern, or password)
|
|
18
|
+
BiometryType[BiometryType["DEVICE_CREDENTIAL"] = 7] = "DEVICE_CREDENTIAL";
|
|
17
19
|
})(BiometryType || (BiometryType = {}));
|
|
18
20
|
export var AuthenticationStrength;
|
|
19
21
|
(function (AuthenticationStrength) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,YAiBX;AAjBD,WAAY,YAAY;IACtB,eAAe;IACf,+CAAQ,CAAA;IACR,MAAM;IACN,uDAAY,CAAA;IACZ,MAAM;IACN,qDAAW,CAAA;IACX,UAAU;IACV,6DAAe,CAAA;IACf,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,6EAAuB,CAAA;IACvB,UAAU;IACV,uDAAY,CAAA;IACZ,2DAA2D;IAC3D,yEAAqB,CAAA;AACvB,CAAC,EAjBW,YAAY,KAAZ,YAAY,QAiBvB;AAED,MAAM,CAAN,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC;;OAEG;IACH,mEAAQ,CAAA;IACR;;;OAGG;IACH,uEAAU,CAAA;IACV;;;OAGG;IACH,mEAAQ,CAAA;AACV,CAAC,EAfW,sBAAsB,KAAtB,sBAAsB,QAejC;AAuGD;;;;;;GAMG;AACH,MAAM,CAAN,IAAY,kBAiEX;AAjED,WAAY,kBAAkB;IAC5B;;OAEG;IACH,6EAAiB,CAAA;IACjB;;;OAGG;IACH,+FAA0B,CAAA;IAC1B;;;OAGG;IACH,2EAAgB,CAAA;IAChB;;;OAGG;IACH,iGAA2B,CAAA;IAC3B;;;OAGG;IACH,+FAA0B,CAAA;IAC1B;;;OAGG;IACH,8FAA0B,CAAA;IAC1B;;;OAGG;IACH,wEAAe,CAAA;IACf;;;OAGG;IACH,kFAAoB,CAAA;IACpB;;;OAGG;IACH,kFAAoB,CAAA;IACpB;;;OAGG;IACH,oFAAqB,CAAA;IACrB;;;OAGG;IACH,8EAAkB,CAAA;IAClB;;;OAGG;IACH,0EAAgB,CAAA;IAChB;;;OAGG;IACH,8EAAkB,CAAA;AACpB,CAAC,EAjEW,kBAAkB,KAAlB,kBAAkB,QAiE7B","sourcesContent":["import type { PluginListenerHandle } from '@capacitor/core';\n\nexport enum BiometryType {\n // Android, iOS\n NONE = 0,\n // iOS\n TOUCH_ID = 1,\n // iOS\n FACE_ID = 2,\n // Android\n FINGERPRINT = 3,\n // Android\n FACE_AUTHENTICATION = 4,\n // Android\n IRIS_AUTHENTICATION = 5,\n // Android\n MULTIPLE = 6,\n // Android - Device credentials (PIN, pattern, or password)\n DEVICE_CREDENTIAL = 7,\n}\n\nexport enum AuthenticationStrength {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n NONE = 0,\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n STRONG = 1,\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n WEAK = 2,\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface IsAvailableOptions {\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication is not available.\n */\n useFallback: boolean;\n}\n\n/**\n * Result from isAvailable() method indicating biometric authentication availability.\n */\nexport interface AvailableResult {\n /**\n * Whether authentication is available (biometric or fallback if useFallback is true)\n */\n isAvailable: boolean;\n /**\n * The strength of available authentication method (STRONG, WEAK, or NONE)\n */\n authenticationStrength: AuthenticationStrength;\n /**\n * The primary biometry type available on the device.\n * On Android devices with multiple biometry types, this returns MULTIPLE.\n * Use this for display purposes only - always use isAvailable for logic decisions.\n */\n biometryType: BiometryType;\n /**\n * Whether the device has a secure lock screen (PIN, pattern, or password).\n * This is independent of biometric enrollment.\n */\n deviceIsSecure: boolean;\n /**\n * Whether strong biometry (Face ID, Touch ID, or fingerprint on devices that consider it strong)\n * is specifically available, separate from weak biometry or device credentials.\n */\n strongBiometryIsAvailable: boolean;\n /**\n * Error code from BiometricAuthError enum. Only present when isAvailable is false.\n * Indicates why biometric authentication is not available.\n * @see BiometricAuthError\n */\n errorCode?: BiometricAuthError;\n}\n\nexport interface BiometricOptions {\n reason?: string;\n title?: string;\n subtitle?: string;\n description?: string;\n negativeButtonText?: string;\n /**\n * Specifies if should fallback to passcode authentication if biometric authentication fails.\n */\n useFallback?: boolean;\n /**\n * Only for iOS.\n * Set the text for the fallback button in the authentication dialog.\n * If this property is not specified, the default text is set by the system.\n */\n fallbackTitle?: string;\n /**\n * Only for Android.\n * Set a maximum number of attempts for biometric authentication. The maximum allowed by android is 5.\n * @default 1\n */\n maxAttempts?: number;\n /**\n * Only for Android.\n * Specify which biometry types are allowed for authentication.\n * If not specified, all available types will be allowed.\n * @example [BiometryType.FINGERPRINT, BiometryType.FACE_AUTHENTICATION]\n */\n allowedBiometryTypes?: BiometryType[];\n}\n\nexport interface GetCredentialOptions {\n server: string;\n}\n\nexport interface SetCredentialOptions {\n username: string;\n password: string;\n server: string;\n}\n\nexport interface DeleteCredentialOptions {\n server: string;\n}\n\nexport interface IsCredentialsSavedOptions {\n server: string;\n}\n\nexport interface IsCredentialsSavedResult {\n isSaved: boolean;\n}\n\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport enum BiometricAuthError {\n /**\n * Unknown error occurred\n */\n UNKNOWN_ERROR = 0,\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BIOMETRICS_UNAVAILABLE = 1,\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n USER_LOCKOUT = 2,\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BIOMETRICS_NOT_ENROLLED = 3,\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n USER_TEMPORARY_LOCKOUT = 4,\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n AUTHENTICATION_FAILED = 10,\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n APP_CANCEL = 11,\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n INVALID_CONTEXT = 12,\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n NOT_INTERACTIVE = 13,\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n PASSCODE_NOT_SET = 14,\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n SYSTEM_CANCEL = 15,\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n USER_CANCEL = 16,\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n USER_FALLBACK = 17,\n}\n\n/**\n * Callback type for biometry change listener\n */\nexport type BiometryChangeListener = (result: AvailableResult) => void;\n\nexport interface NativeBiometricPlugin {\n /**\n * Checks if biometric authentication hardware is available.\n * @param {IsAvailableOptions} [options]\n * @returns {Promise<AvailableResult>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n isAvailable(options?: IsAvailableOptions): Promise<AvailableResult>;\n\n /**\n * Adds a listener that is called when the app resumes from background.\n * This is useful to detect if biometry availability has changed while\n * the app was in the background (e.g., user enrolled/unenrolled biometrics).\n *\n * @param eventName - Must be 'biometryChange'\n * @param {BiometryChangeListener} listener - Callback function that receives the updated AvailableResult\n * @returns {Promise<PluginListenerHandle>} Handle to remove the listener\n * @since 7.6.0\n *\n * @example\n * ```typescript\n * const handle = await NativeBiometric.addListener('biometryChange', (result) => {\n * console.log('Biometry availability changed:', result.isAvailable);\n * });\n *\n * // To remove the listener:\n * await handle.remove();\n * ```\n */\n addListener(eventName: 'biometryChange', listener: BiometryChangeListener): Promise<PluginListenerHandle>;\n /**\n * Prompts the user to authenticate with biometrics.\n * @param {BiometricOptions} [options]\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n verifyIdentity(options?: BiometricOptions): Promise<void>;\n /**\n * Gets the stored credentials for a given server.\n * @param {GetCredentialOptions} options\n * @returns {Promise<Credentials>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n getCredentials(options: GetCredentialOptions): Promise<Credentials>;\n /**\n * Stores the given credentials for a given server.\n * @param {SetCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n setCredentials(options: SetCredentialOptions): Promise<void>;\n /**\n * Deletes the stored credentials for a given server.\n * @param {DeleteCredentialOptions} options\n * @returns {Promise<any>}\n * @memberof NativeBiometricPlugin\n * @since 1.0.0\n */\n deleteCredentials(options: DeleteCredentialOptions): Promise<void>;\n /**\n * Checks if credentials are already saved for a given server.\n * @param {IsCredentialsSavedOptions} options\n * @returns {Promise<IsCredentialsSavedResult>}\n * @memberof NativeBiometricPlugin\n * @since 7.3.0\n */\n isCredentialsSaved(options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult>;\n\n /**\n * Get the native Capacitor plugin version.\n *\n * @returns Promise that resolves with the plugin version\n * @since 1.0.0\n */\n getPluginVersion(): Promise<{ version: string }>;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -2,6 +2,12 @@ import { WebPlugin } from '@capacitor/core';
|
|
|
2
2
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
3
3
|
import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, SetCredentialOptions, DeleteCredentialOptions, IsCredentialsSavedOptions, IsCredentialsSavedResult, Credentials, BiometryChangeListener } from './definitions';
|
|
4
4
|
export declare class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {
|
|
5
|
+
/**
|
|
6
|
+
* In-memory credential storage for browser development/testing.
|
|
7
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
8
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
9
|
+
*/
|
|
10
|
+
private credentialStore;
|
|
5
11
|
constructor();
|
|
6
12
|
isAvailable(): Promise<AvailableResult>;
|
|
7
13
|
addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle>;
|
package/dist/esm/web.js
CHANGED
|
@@ -3,15 +3,22 @@ import { BiometryType, AuthenticationStrength } from './definitions';
|
|
|
3
3
|
export class NativeBiometricWeb extends WebPlugin {
|
|
4
4
|
constructor() {
|
|
5
5
|
super();
|
|
6
|
+
/**
|
|
7
|
+
* In-memory credential storage for browser development/testing.
|
|
8
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
9
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
10
|
+
*/
|
|
11
|
+
this.credentialStore = new Map();
|
|
6
12
|
}
|
|
7
13
|
isAvailable() {
|
|
8
|
-
// Web platform:
|
|
14
|
+
// Web platform: return a dummy implementation for development/testing
|
|
15
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
9
16
|
return Promise.resolve({
|
|
10
|
-
isAvailable:
|
|
11
|
-
authenticationStrength: AuthenticationStrength.
|
|
12
|
-
biometryType: BiometryType.
|
|
13
|
-
deviceIsSecure:
|
|
14
|
-
strongBiometryIsAvailable:
|
|
17
|
+
isAvailable: true,
|
|
18
|
+
authenticationStrength: AuthenticationStrength.STRONG,
|
|
19
|
+
biometryType: BiometryType.TOUCH_ID,
|
|
20
|
+
deviceIsSecure: true,
|
|
21
|
+
strongBiometryIsAvailable: true,
|
|
15
22
|
});
|
|
16
23
|
}
|
|
17
24
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -23,26 +30,40 @@ export class NativeBiometricWeb extends WebPlugin {
|
|
|
23
30
|
},
|
|
24
31
|
};
|
|
25
32
|
}
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
26
34
|
verifyIdentity(_options) {
|
|
27
|
-
console.log('verifyIdentity
|
|
28
|
-
|
|
35
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
36
|
+
// Dummy implementation: always succeeds for browser testing
|
|
37
|
+
return Promise.resolve();
|
|
29
38
|
}
|
|
30
39
|
getCredentials(_options) {
|
|
31
|
-
console.log('getCredentials', _options);
|
|
32
|
-
|
|
40
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
41
|
+
// Dummy implementation: retrieve from in-memory store
|
|
42
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
43
|
+
if (!credentials) {
|
|
44
|
+
throw new Error('No credentials found for the specified server');
|
|
45
|
+
}
|
|
46
|
+
return Promise.resolve(credentials);
|
|
33
47
|
}
|
|
34
48
|
setCredentials(_options) {
|
|
35
|
-
console.log('setCredentials', _options);
|
|
36
|
-
|
|
49
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
50
|
+
// Dummy implementation: store in memory
|
|
51
|
+
this.credentialStore.set(_options.server, {
|
|
52
|
+
username: _options.username,
|
|
53
|
+
password: _options.password,
|
|
54
|
+
});
|
|
55
|
+
return Promise.resolve();
|
|
37
56
|
}
|
|
38
57
|
deleteCredentials(_options) {
|
|
39
|
-
console.log('deleteCredentials', _options);
|
|
40
|
-
|
|
58
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
59
|
+
// Dummy implementation: remove from in-memory store
|
|
60
|
+
this.credentialStore.delete(_options.server);
|
|
61
|
+
return Promise.resolve();
|
|
41
62
|
}
|
|
42
63
|
isCredentialsSaved(_options) {
|
|
43
|
-
console.log('isCredentialsSaved', _options);
|
|
44
|
-
//
|
|
45
|
-
return Promise.resolve({ isSaved:
|
|
64
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
65
|
+
// Dummy implementation: check in-memory store
|
|
66
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
46
67
|
}
|
|
47
68
|
async getPluginVersion() {
|
|
48
69
|
return { version: 'web' };
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAe5C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAQ/C;QACE,KAAK,EAAE,CAAC;QARV;;;;WAIG;QACK,oBAAe,GAA6B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EAAE;YACxC,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;SAC5B,CAAC,CAAC;QACH,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,iBAAiB,CAAC,QAAiC;QACjD,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACrF,oDAAoD;QACpD,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,kBAAkB,CAAC,QAAmC;QACpD,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QACtF,8CAA8C;QAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nimport type {\n NativeBiometricPlugin,\n AvailableResult,\n BiometricOptions,\n GetCredentialOptions,\n SetCredentialOptions,\n DeleteCredentialOptions,\n IsCredentialsSavedOptions,\n IsCredentialsSavedResult,\n Credentials,\n BiometryChangeListener,\n} from './definitions';\nimport { BiometryType, AuthenticationStrength } from './definitions';\n\nexport class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n private credentialStore: Map<string, Credentials> = new Map();\n\n constructor() {\n super();\n }\n\n isAvailable(): Promise<AvailableResult> {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle> {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options?: BiometricOptions): Promise<void> {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n\n getCredentials(_options: GetCredentialOptions): Promise<Credentials> {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n\n setCredentials(_options: SetCredentialOptions): Promise<void> {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n\n deleteCredentials(_options: DeleteCredentialOptions): Promise<void> {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n\n isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult> {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -18,6 +18,8 @@ exports.BiometryType = void 0;
|
|
|
18
18
|
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
|
|
19
19
|
// Android
|
|
20
20
|
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
|
|
21
|
+
// Android - Device credentials (PIN, pattern, or password)
|
|
22
|
+
BiometryType[BiometryType["DEVICE_CREDENTIAL"] = 7] = "DEVICE_CREDENTIAL";
|
|
21
23
|
})(exports.BiometryType || (exports.BiometryType = {}));
|
|
22
24
|
exports.AuthenticationStrength = void 0;
|
|
23
25
|
(function (AuthenticationStrength) {
|
|
@@ -118,15 +120,22 @@ const NativeBiometric = core.registerPlugin('NativeBiometric', {
|
|
|
118
120
|
class NativeBiometricWeb extends core.WebPlugin {
|
|
119
121
|
constructor() {
|
|
120
122
|
super();
|
|
123
|
+
/**
|
|
124
|
+
* In-memory credential storage for browser development/testing.
|
|
125
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
126
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
127
|
+
*/
|
|
128
|
+
this.credentialStore = new Map();
|
|
121
129
|
}
|
|
122
130
|
isAvailable() {
|
|
123
|
-
// Web platform:
|
|
131
|
+
// Web platform: return a dummy implementation for development/testing
|
|
132
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
124
133
|
return Promise.resolve({
|
|
125
|
-
isAvailable:
|
|
126
|
-
authenticationStrength: exports.AuthenticationStrength.
|
|
127
|
-
biometryType: exports.BiometryType.
|
|
128
|
-
deviceIsSecure:
|
|
129
|
-
strongBiometryIsAvailable:
|
|
134
|
+
isAvailable: true,
|
|
135
|
+
authenticationStrength: exports.AuthenticationStrength.STRONG,
|
|
136
|
+
biometryType: exports.BiometryType.TOUCH_ID,
|
|
137
|
+
deviceIsSecure: true,
|
|
138
|
+
strongBiometryIsAvailable: true,
|
|
130
139
|
});
|
|
131
140
|
}
|
|
132
141
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -138,26 +147,40 @@ class NativeBiometricWeb extends core.WebPlugin {
|
|
|
138
147
|
},
|
|
139
148
|
};
|
|
140
149
|
}
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
141
151
|
verifyIdentity(_options) {
|
|
142
|
-
console.log('verifyIdentity
|
|
143
|
-
|
|
152
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
153
|
+
// Dummy implementation: always succeeds for browser testing
|
|
154
|
+
return Promise.resolve();
|
|
144
155
|
}
|
|
145
156
|
getCredentials(_options) {
|
|
146
|
-
console.log('getCredentials', _options);
|
|
147
|
-
|
|
157
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
158
|
+
// Dummy implementation: retrieve from in-memory store
|
|
159
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
160
|
+
if (!credentials) {
|
|
161
|
+
throw new Error('No credentials found for the specified server');
|
|
162
|
+
}
|
|
163
|
+
return Promise.resolve(credentials);
|
|
148
164
|
}
|
|
149
165
|
setCredentials(_options) {
|
|
150
|
-
console.log('setCredentials', _options);
|
|
151
|
-
|
|
166
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
167
|
+
// Dummy implementation: store in memory
|
|
168
|
+
this.credentialStore.set(_options.server, {
|
|
169
|
+
username: _options.username,
|
|
170
|
+
password: _options.password,
|
|
171
|
+
});
|
|
172
|
+
return Promise.resolve();
|
|
152
173
|
}
|
|
153
174
|
deleteCredentials(_options) {
|
|
154
|
-
console.log('deleteCredentials', _options);
|
|
155
|
-
|
|
175
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
176
|
+
// Dummy implementation: remove from in-memory store
|
|
177
|
+
this.credentialStore.delete(_options.server);
|
|
178
|
+
return Promise.resolve();
|
|
156
179
|
}
|
|
157
180
|
isCredentialsSaved(_options) {
|
|
158
|
-
console.log('isCredentialsSaved', _options);
|
|
159
|
-
//
|
|
160
|
-
return Promise.resolve({ isSaved:
|
|
181
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
182
|
+
// Dummy implementation: check in-memory store
|
|
183
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
161
184
|
}
|
|
162
185
|
async getPluginVersion() {
|
|
163
186
|
return { version: 'web' };
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;AACjE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;AACX,CAAC,UAAU,sBAAsB,EAAE;AACnC;AACA;AACA;AACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACvE;AACA;AACA;AACA;AACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;AAC3E;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AG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC;AACrF,IAAI;AACJ,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;AAC/E,IAAI;AACJ,IAAI,cAAc,CAAC,QAAQ,EAAE;AAC7B,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,CAAC;AAC/C,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;AAC/E,IAAI;AACJ,IAAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,QAAQ,CAAC;AAClD,QAAQ,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC;AAC/E,IAAI;AACJ,IAAI,kBAAkB,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,QAAQ,CAAC;AACnD;AACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAClD,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n this.credentialStore = new Map();\n }\n isAvailable() {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options) {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n getCredentials(_options) {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n setCredentials(_options) {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;;AAAWA;AACX,CAAC,UAAU,YAAY,EAAE;AACzB;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACnD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;AACzD;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;AACjE;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;AACjF;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;AAC3D;AACA,IAAI,YAAY,CAAC,YAAY,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,GAAG,mBAAmB;AAC7E,CAAC,EAAEA,oBAAY,KAAKA,oBAAY,GAAG,EAAE,CAAC,CAAC;AAC5BC;AACX,CAAC,UAAU,sBAAsB,EAAE;AACnC;AACA;AACA;AACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;AACvE;AACA;AACA;AACA;AACA,IAAI,sBAAsB,CAAC,sBAAsB,CAAC,QAAQ,CAAC,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AAQ,OAAO,OAAO,CAAC,OAAO,EAAE;AAChC,IAAI;AACJ,IAAI,kBAAkB,CAAC,QAAQ,EAAE;AACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC7F;AACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;AACtF,IAAI;AACJ,IAAI,MAAM,gBAAgB,GAAG;AAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;AACjC,IAAI;AACJ;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -17,6 +17,8 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
17
17
|
BiometryType[BiometryType["IRIS_AUTHENTICATION"] = 5] = "IRIS_AUTHENTICATION";
|
|
18
18
|
// Android
|
|
19
19
|
BiometryType[BiometryType["MULTIPLE"] = 6] = "MULTIPLE";
|
|
20
|
+
// Android - Device credentials (PIN, pattern, or password)
|
|
21
|
+
BiometryType[BiometryType["DEVICE_CREDENTIAL"] = 7] = "DEVICE_CREDENTIAL";
|
|
20
22
|
})(exports.BiometryType || (exports.BiometryType = {}));
|
|
21
23
|
exports.AuthenticationStrength = void 0;
|
|
22
24
|
(function (AuthenticationStrength) {
|
|
@@ -117,15 +119,22 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
117
119
|
class NativeBiometricWeb extends core.WebPlugin {
|
|
118
120
|
constructor() {
|
|
119
121
|
super();
|
|
122
|
+
/**
|
|
123
|
+
* In-memory credential storage for browser development/testing.
|
|
124
|
+
* Credentials are stored temporarily and cleared on page refresh.
|
|
125
|
+
* This is NOT secure storage and should only be used for development purposes.
|
|
126
|
+
*/
|
|
127
|
+
this.credentialStore = new Map();
|
|
120
128
|
}
|
|
121
129
|
isAvailable() {
|
|
122
|
-
// Web platform:
|
|
130
|
+
// Web platform: return a dummy implementation for development/testing
|
|
131
|
+
// Using TOUCH_ID as a generic placeholder for simulated biometric authentication
|
|
123
132
|
return Promise.resolve({
|
|
124
|
-
isAvailable:
|
|
125
|
-
authenticationStrength: exports.AuthenticationStrength.
|
|
126
|
-
biometryType: exports.BiometryType.
|
|
127
|
-
deviceIsSecure:
|
|
128
|
-
strongBiometryIsAvailable:
|
|
133
|
+
isAvailable: true,
|
|
134
|
+
authenticationStrength: exports.AuthenticationStrength.STRONG,
|
|
135
|
+
biometryType: exports.BiometryType.TOUCH_ID,
|
|
136
|
+
deviceIsSecure: true,
|
|
137
|
+
strongBiometryIsAvailable: true,
|
|
129
138
|
});
|
|
130
139
|
}
|
|
131
140
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
@@ -137,26 +146,40 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
137
146
|
},
|
|
138
147
|
};
|
|
139
148
|
}
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
140
150
|
verifyIdentity(_options) {
|
|
141
|
-
console.log('verifyIdentity
|
|
142
|
-
|
|
151
|
+
console.log('verifyIdentity (dummy implementation)');
|
|
152
|
+
// Dummy implementation: always succeeds for browser testing
|
|
153
|
+
return Promise.resolve();
|
|
143
154
|
}
|
|
144
155
|
getCredentials(_options) {
|
|
145
|
-
console.log('getCredentials', _options);
|
|
146
|
-
|
|
156
|
+
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
157
|
+
// Dummy implementation: retrieve from in-memory store
|
|
158
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
159
|
+
if (!credentials) {
|
|
160
|
+
throw new Error('No credentials found for the specified server');
|
|
161
|
+
}
|
|
162
|
+
return Promise.resolve(credentials);
|
|
147
163
|
}
|
|
148
164
|
setCredentials(_options) {
|
|
149
|
-
console.log('setCredentials', _options);
|
|
150
|
-
|
|
165
|
+
console.log('setCredentials (dummy implementation)', { server: _options.server });
|
|
166
|
+
// Dummy implementation: store in memory
|
|
167
|
+
this.credentialStore.set(_options.server, {
|
|
168
|
+
username: _options.username,
|
|
169
|
+
password: _options.password,
|
|
170
|
+
});
|
|
171
|
+
return Promise.resolve();
|
|
151
172
|
}
|
|
152
173
|
deleteCredentials(_options) {
|
|
153
|
-
console.log('deleteCredentials', _options);
|
|
154
|
-
|
|
174
|
+
console.log('deleteCredentials (dummy implementation)', { server: _options.server });
|
|
175
|
+
// Dummy implementation: remove from in-memory store
|
|
176
|
+
this.credentialStore.delete(_options.server);
|
|
177
|
+
return Promise.resolve();
|
|
155
178
|
}
|
|
156
179
|
isCredentialsSaved(_options) {
|
|
157
|
-
console.log('isCredentialsSaved', _options);
|
|
158
|
-
//
|
|
159
|
-
return Promise.resolve({ isSaved:
|
|
180
|
+
console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });
|
|
181
|
+
// Dummy implementation: check in-memory store
|
|
182
|
+
return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });
|
|
160
183
|
}
|
|
161
184
|
async getPluginVersion() {
|
|
162
185
|
return { version: 'web' };
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n }\n isAvailable() {\n // Web platform: biometrics not available, but return structured response\n return Promise.resolve({\n isAvailable: false,\n authenticationStrength: AuthenticationStrength.NONE,\n biometryType: BiometryType.NONE,\n deviceIsSecure: false,\n strongBiometryIsAvailable: false,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n verifyIdentity(_options) {\n console.log('verifyIdentity', _options);\n throw new Error('Biometric authentication is not available on web platform.');\n }\n getCredentials(_options) {\n console.log('getCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n setCredentials(_options) {\n console.log('setCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials', _options);\n throw new Error('Credential storage is not available on web platform.');\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved', _options);\n // Return false on web - no credentials can be saved\n return Promise.resolve({ isSaved: false });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IACzD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;IACjE;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;IACjF;IACA,IAAI,YAAY,CAAC,YAAY,C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KAAK,EAAE,CAAC;IAClD,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["export var BiometryType;\n(function (BiometryType) {\n // Android, iOS\n BiometryType[BiometryType[\"NONE\"] = 0] = \"NONE\";\n // iOS\n BiometryType[BiometryType[\"TOUCH_ID\"] = 1] = \"TOUCH_ID\";\n // iOS\n BiometryType[BiometryType[\"FACE_ID\"] = 2] = \"FACE_ID\";\n // Android\n BiometryType[BiometryType[\"FINGERPRINT\"] = 3] = \"FINGERPRINT\";\n // Android\n BiometryType[BiometryType[\"FACE_AUTHENTICATION\"] = 4] = \"FACE_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"IRIS_AUTHENTICATION\"] = 5] = \"IRIS_AUTHENTICATION\";\n // Android\n BiometryType[BiometryType[\"MULTIPLE\"] = 6] = \"MULTIPLE\";\n // Android - Device credentials (PIN, pattern, or password)\n BiometryType[BiometryType[\"DEVICE_CREDENTIAL\"] = 7] = \"DEVICE_CREDENTIAL\";\n})(BiometryType || (BiometryType = {}));\nexport var AuthenticationStrength;\n(function (AuthenticationStrength) {\n /**\n * No authentication available, even if PIN is available but useFallback = false\n */\n AuthenticationStrength[AuthenticationStrength[\"NONE\"] = 0] = \"NONE\";\n /**\n * Strong authentication: Face ID on iOS, fingerprints on devices that consider fingerprints strong (Android).\n * Note: PIN/pattern/password is NEVER considered STRONG, even when useFallback = true.\n */\n AuthenticationStrength[AuthenticationStrength[\"STRONG\"] = 1] = \"STRONG\";\n /**\n * Weak authentication: Face authentication on Android devices that consider face weak,\n * or PIN/pattern/password if useFallback = true (PIN is always WEAK, never STRONG).\n */\n AuthenticationStrength[AuthenticationStrength[\"WEAK\"] = 2] = \"WEAK\";\n})(AuthenticationStrength || (AuthenticationStrength = {}));\n/**\n * Biometric authentication error codes.\n * These error codes are used in both isAvailable() and verifyIdentity() methods.\n *\n * Keep this in sync with BiometricAuthError in README.md\n * Update whenever `convertToPluginErrorCode` functions are modified\n */\nexport var BiometricAuthError;\n(function (BiometricAuthError) {\n /**\n * Unknown error occurred\n */\n BiometricAuthError[BiometricAuthError[\"UNKNOWN_ERROR\"] = 0] = \"UNKNOWN_ERROR\";\n /**\n * Biometrics are unavailable (no hardware or hardware error)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_UNAVAILABLE\"] = 1] = \"BIOMETRICS_UNAVAILABLE\";\n /**\n * User has been locked out due to too many failed attempts\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_LOCKOUT\"] = 2] = \"USER_LOCKOUT\";\n /**\n * No biometrics are enrolled on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"BIOMETRICS_NOT_ENROLLED\"] = 3] = \"BIOMETRICS_NOT_ENROLLED\";\n /**\n * User is temporarily locked out (Android: 30 second lockout)\n * Platform: Android\n */\n BiometricAuthError[BiometricAuthError[\"USER_TEMPORARY_LOCKOUT\"] = 4] = \"USER_TEMPORARY_LOCKOUT\";\n /**\n * Authentication failed (user did not authenticate successfully)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"AUTHENTICATION_FAILED\"] = 10] = \"AUTHENTICATION_FAILED\";\n /**\n * App canceled the authentication (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"APP_CANCEL\"] = 11] = \"APP_CANCEL\";\n /**\n * Invalid context (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"INVALID_CONTEXT\"] = 12] = \"INVALID_CONTEXT\";\n /**\n * Authentication was not interactive (iOS only)\n * Platform: iOS\n */\n BiometricAuthError[BiometricAuthError[\"NOT_INTERACTIVE\"] = 13] = \"NOT_INTERACTIVE\";\n /**\n * Passcode/PIN is not set on the device\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"PASSCODE_NOT_SET\"] = 14] = \"PASSCODE_NOT_SET\";\n /**\n * System canceled the authentication (e.g., due to screen lock)\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"SYSTEM_CANCEL\"] = 15] = \"SYSTEM_CANCEL\";\n /**\n * User canceled the authentication\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_CANCEL\"] = 16] = \"USER_CANCEL\";\n /**\n * User chose to use fallback authentication method\n * Platform: Android, iOS\n */\n BiometricAuthError[BiometricAuthError[\"USER_FALLBACK\"] = 17] = \"USER_FALLBACK\";\n})(BiometricAuthError || (BiometricAuthError = {}));\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst NativeBiometric = registerPlugin('NativeBiometric', {\n web: () => import('./web').then((m) => new m.NativeBiometricWeb()),\n});\nexport * from './definitions';\nexport { NativeBiometric };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nimport { BiometryType, AuthenticationStrength } from './definitions';\nexport class NativeBiometricWeb extends WebPlugin {\n constructor() {\n super();\n /**\n * In-memory credential storage for browser development/testing.\n * Credentials are stored temporarily and cleared on page refresh.\n * This is NOT secure storage and should only be used for development purposes.\n */\n this.credentialStore = new Map();\n }\n isAvailable() {\n // Web platform: return a dummy implementation for development/testing\n // Using TOUCH_ID as a generic placeholder for simulated biometric authentication\n return Promise.resolve({\n isAvailable: true,\n authenticationStrength: AuthenticationStrength.STRONG,\n biometryType: BiometryType.TOUCH_ID,\n deviceIsSecure: true,\n strongBiometryIsAvailable: true,\n });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async addListener(_eventName, _listener) {\n // Web platform: no-op, but return a valid handle\n return {\n remove: async () => {\n // Nothing to remove on web\n },\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n verifyIdentity(_options) {\n console.log('verifyIdentity (dummy implementation)');\n // Dummy implementation: always succeeds for browser testing\n return Promise.resolve();\n }\n getCredentials(_options) {\n console.log('getCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: retrieve from in-memory store\n const credentials = this.credentialStore.get(_options.server);\n if (!credentials) {\n throw new Error('No credentials found for the specified server');\n }\n return Promise.resolve(credentials);\n }\n setCredentials(_options) {\n console.log('setCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: store in memory\n this.credentialStore.set(_options.server, {\n username: _options.username,\n password: _options.password,\n });\n return Promise.resolve();\n }\n deleteCredentials(_options) {\n console.log('deleteCredentials (dummy implementation)', { server: _options.server });\n // Dummy implementation: remove from in-memory store\n this.credentialStore.delete(_options.server);\n return Promise.resolve();\n }\n isCredentialsSaved(_options) {\n console.log('isCredentialsSaved (dummy implementation)', { server: _options.server });\n // Dummy implementation: check in-memory store\n return Promise.resolve({ isSaved: this.credentialStore.has(_options.server) });\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["BiometryType","AuthenticationStrength","BiometricAuthError","registerPlugin","WebPlugin"],"mappings":";;;AAAWA;IACX,CAAC,UAAU,YAAY,EAAE;IACzB;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM;IACnD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;IAC3D;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IACzD;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,GAAG,aAAa;IACjE;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAqB;IACjF;IACA,IAAI,YAAY,CAAC,YAAY,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GAAG,qBAAq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AI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE;IAClD,YAAY,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IACvC,YAAY,QAAQ,EAAE,QAAQ,CAAC,QAAQ;IACvC,SAAS,CAAC;IACV,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;IAChC,IAAI;IACJ,IAAI,iBAAiB,CAAC,QAAQ,EAAE;IAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC5F;IACA,QAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IACpD,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE;IAChC,IAAI;IACJ,IAAI,kBAAkB,CAAC,QAAQ,EAAE;IACjC,QAAQ,OAAO,CAAC,GAAG,CAAC,2CAA2C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC7F;IACA,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;IACtF,IAAI;IACJ,IAAI,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;IACjC,IAAI;IACJ;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,7 @@ import LocalAuthentication
|
|
|
11
11
|
|
|
12
12
|
@objc(NativeBiometricPlugin)
|
|
13
13
|
public class NativeBiometricPlugin: CAPPlugin, CAPBridgedPlugin {
|
|
14
|
-
private let pluginVersion: String = "8.0
|
|
14
|
+
private let pluginVersion: String = "8.2.0"
|
|
15
15
|
public let identifier = "NativeBiometricPlugin"
|
|
16
16
|
public let jsName = "NativeBiometric"
|
|
17
17
|
public let pluginMethods: [CAPPluginMethod] = [
|
package/package.json
CHANGED