@capgo/capacitor-native-biometric 8.3.7 → 8.4.1
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 +51 -5
- package/android/build.gradle +1 -1
- package/android/src/main/java/ee/forgr/biometric/AuthActivity.java +164 -6
- package/android/src/main/java/ee/forgr/biometric/NativeBiometric.java +93 -5
- package/dist/docs.json +128 -0
- package/dist/esm/definitions.d.ts +73 -0
- package/dist/esm/definitions.js +20 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/web.d.ts +2 -1
- package/dist/esm/web.js +8 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +28 -1
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +28 -1
- package/dist/plugin.js.map +1 -1
- package/ios/Sources/NativeBiometricPlugin/NativeBiometricPlugin.swift +133 -11
- package/package.json +1 -1
|
@@ -25,6 +25,25 @@ export declare enum AuthenticationStrength {
|
|
|
25
25
|
*/
|
|
26
26
|
WEAK = 2
|
|
27
27
|
}
|
|
28
|
+
export declare enum AccessControl {
|
|
29
|
+
/**
|
|
30
|
+
* No biometric protection. Credentials are accessible without authentication.
|
|
31
|
+
* This is the default behavior for backward compatibility.
|
|
32
|
+
*/
|
|
33
|
+
NONE = 0,
|
|
34
|
+
/**
|
|
35
|
+
* Biometric authentication required for credential access.
|
|
36
|
+
* Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).
|
|
37
|
+
* More secure but credentials are lost if user modifies their biometric enrollment.
|
|
38
|
+
*/
|
|
39
|
+
BIOMETRY_CURRENT_SET = 1,
|
|
40
|
+
/**
|
|
41
|
+
* Biometric authentication required for credential access.
|
|
42
|
+
* Credentials survive new biometric enrollment (e.g., adding a new fingerprint).
|
|
43
|
+
* More lenient — recommended for most apps.
|
|
44
|
+
*/
|
|
45
|
+
BIOMETRY_ANY = 2
|
|
46
|
+
}
|
|
28
47
|
export interface Credentials {
|
|
29
48
|
username: string;
|
|
30
49
|
password: string;
|
|
@@ -113,6 +132,47 @@ export interface SetCredentialOptions {
|
|
|
113
132
|
username: string;
|
|
114
133
|
password: string;
|
|
115
134
|
server: string;
|
|
135
|
+
/**
|
|
136
|
+
* Access control level for the stored credentials.
|
|
137
|
+
* When set to BIOMETRY_CURRENT_SET or BIOMETRY_ANY, the credentials are
|
|
138
|
+
* hardware-protected and require biometric authentication to access.
|
|
139
|
+
*
|
|
140
|
+
* On iOS, this adds SecAccessControl to the Keychain item.
|
|
141
|
+
* On Android, this creates a biometric-protected Keystore key and requires
|
|
142
|
+
* BiometricPrompt authentication for both storing and retrieving credentials.
|
|
143
|
+
*
|
|
144
|
+
* @default AccessControl.NONE
|
|
145
|
+
* @since 8.4.0
|
|
146
|
+
*/
|
|
147
|
+
accessControl?: AccessControl;
|
|
148
|
+
}
|
|
149
|
+
export interface GetSecureCredentialsOptions {
|
|
150
|
+
server: string;
|
|
151
|
+
/**
|
|
152
|
+
* Reason for requesting biometric authentication.
|
|
153
|
+
* Displayed in the biometric prompt on both iOS and Android.
|
|
154
|
+
*/
|
|
155
|
+
reason?: string;
|
|
156
|
+
/**
|
|
157
|
+
* Title for the biometric prompt.
|
|
158
|
+
* Only for Android.
|
|
159
|
+
*/
|
|
160
|
+
title?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Subtitle for the biometric prompt.
|
|
163
|
+
* Only for Android.
|
|
164
|
+
*/
|
|
165
|
+
subtitle?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Description for the biometric prompt.
|
|
168
|
+
* Only for Android.
|
|
169
|
+
*/
|
|
170
|
+
description?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Text for the negative/cancel button.
|
|
173
|
+
* Only for Android.
|
|
174
|
+
*/
|
|
175
|
+
negativeButtonText?: string;
|
|
116
176
|
}
|
|
117
177
|
export interface DeleteCredentialOptions {
|
|
118
178
|
server: string;
|
|
@@ -262,6 +322,19 @@ export interface NativeBiometricPlugin {
|
|
|
262
322
|
* @since 1.0.0
|
|
263
323
|
*/
|
|
264
324
|
deleteCredentials(options: DeleteCredentialOptions): Promise<void>;
|
|
325
|
+
/**
|
|
326
|
+
* Gets the stored credentials for a given server, requiring biometric authentication.
|
|
327
|
+
* Credentials must have been stored with accessControl set to BIOMETRY_CURRENT_SET or BIOMETRY_ANY.
|
|
328
|
+
*
|
|
329
|
+
* On iOS, the system automatically shows the biometric prompt when accessing the protected Keychain item.
|
|
330
|
+
* On Android, BiometricPrompt is shown with a CryptoObject bound to the credential decryption key.
|
|
331
|
+
*
|
|
332
|
+
* @param {GetSecureCredentialsOptions} options
|
|
333
|
+
* @returns {Promise<Credentials>}
|
|
334
|
+
* @memberof NativeBiometricPlugin
|
|
335
|
+
* @since 8.4.0
|
|
336
|
+
*/
|
|
337
|
+
getSecureCredentials(options: GetSecureCredentialsOptions): Promise<Credentials>;
|
|
265
338
|
/**
|
|
266
339
|
* Checks if credentials are already saved for a given server.
|
|
267
340
|
* @param {IsCredentialsSavedOptions} options
|
package/dist/esm/definitions.js
CHANGED
|
@@ -34,6 +34,26 @@ export var AuthenticationStrength;
|
|
|
34
34
|
*/
|
|
35
35
|
AuthenticationStrength[AuthenticationStrength["WEAK"] = 2] = "WEAK";
|
|
36
36
|
})(AuthenticationStrength || (AuthenticationStrength = {}));
|
|
37
|
+
export var AccessControl;
|
|
38
|
+
(function (AccessControl) {
|
|
39
|
+
/**
|
|
40
|
+
* No biometric protection. Credentials are accessible without authentication.
|
|
41
|
+
* This is the default behavior for backward compatibility.
|
|
42
|
+
*/
|
|
43
|
+
AccessControl[AccessControl["NONE"] = 0] = "NONE";
|
|
44
|
+
/**
|
|
45
|
+
* Biometric authentication required for credential access.
|
|
46
|
+
* Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).
|
|
47
|
+
* More secure but credentials are lost if user modifies their biometric enrollment.
|
|
48
|
+
*/
|
|
49
|
+
AccessControl[AccessControl["BIOMETRY_CURRENT_SET"] = 1] = "BIOMETRY_CURRENT_SET";
|
|
50
|
+
/**
|
|
51
|
+
* Biometric authentication required for credential access.
|
|
52
|
+
* Credentials survive new biometric enrollment (e.g., adding a new fingerprint).
|
|
53
|
+
* More lenient — recommended for most apps.
|
|
54
|
+
*/
|
|
55
|
+
AccessControl[AccessControl["BIOMETRY_ANY"] = 2] = "BIOMETRY_ANY";
|
|
56
|
+
})(AccessControl || (AccessControl = {}));
|
|
37
57
|
/**
|
|
38
58
|
* Biometric authentication error codes.
|
|
39
59
|
* These error codes are used in both isAvailable() and verifyIdentity() methods.
|
|
@@ -1 +1 @@
|
|
|
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;AA6GD;;;;;;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 * Only for iOS.\n * Specifies if should fallback to passcode authentication if biometric authentication is not available.\n * On Android, this parameter is ignored due to BiometricPrompt API constraints:\n * DEVICE_CREDENTIAL authenticator and negative button (cancel) are mutually exclusive.\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 * Only for iOS.\n * Specifies if should fallback to passcode authentication if biometric authentication fails.\n * On Android, this parameter is ignored due to BiometricPrompt API constraints:\n * DEVICE_CREDENTIAL authenticator and negative button (cancel) are mutually exclusive.\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"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"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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 enum AccessControl {\n /**\n * No biometric protection. Credentials are accessible without authentication.\n * This is the default behavior for backward compatibility.\n */\n NONE = 0,\n /**\n * Biometric authentication required for credential access.\n * Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).\n * More secure but credentials are lost if user modifies their biometric enrollment.\n */\n BIOMETRY_CURRENT_SET = 1,\n /**\n * Biometric authentication required for credential access.\n * Credentials survive new biometric enrollment (e.g., adding a new fingerprint).\n * More lenient — recommended for most apps.\n */\n BIOMETRY_ANY = 2,\n}\n\nexport interface Credentials {\n username: string;\n password: string;\n}\n\nexport interface IsAvailableOptions {\n /**\n * Only for iOS.\n * Specifies if should fallback to passcode authentication if biometric authentication is not available.\n * On Android, this parameter is ignored due to BiometricPrompt API constraints:\n * DEVICE_CREDENTIAL authenticator and negative button (cancel) are mutually exclusive.\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 * Only for iOS.\n * Specifies if should fallback to passcode authentication if biometric authentication fails.\n * On Android, this parameter is ignored due to BiometricPrompt API constraints:\n * DEVICE_CREDENTIAL authenticator and negative button (cancel) are mutually exclusive.\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 * Access control level for the stored credentials.\n * When set to BIOMETRY_CURRENT_SET or BIOMETRY_ANY, the credentials are\n * hardware-protected and require biometric authentication to access.\n *\n * On iOS, this adds SecAccessControl to the Keychain item.\n * On Android, this creates a biometric-protected Keystore key and requires\n * BiometricPrompt authentication for both storing and retrieving credentials.\n *\n * @default AccessControl.NONE\n * @since 8.4.0\n */\n accessControl?: AccessControl;\n}\n\nexport interface GetSecureCredentialsOptions {\n server: string;\n /**\n * Reason for requesting biometric authentication.\n * Displayed in the biometric prompt on both iOS and Android.\n */\n reason?: string;\n /**\n * Title for the biometric prompt.\n * Only for Android.\n */\n title?: string;\n /**\n * Subtitle for the biometric prompt.\n * Only for Android.\n */\n subtitle?: string;\n /**\n * Description for the biometric prompt.\n * Only for Android.\n */\n description?: string;\n /**\n * Text for the negative/cancel button.\n * Only for Android.\n */\n negativeButtonText?: 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 * Gets the stored credentials for a given server, requiring biometric authentication.\n * Credentials must have been stored with accessControl set to BIOMETRY_CURRENT_SET or BIOMETRY_ANY.\n *\n * On iOS, the system automatically shows the biometric prompt when accessing the protected Keychain item.\n * On Android, BiometricPrompt is shown with a CryptoObject bound to the credential decryption key.\n *\n * @param {GetSecureCredentialsOptions} options\n * @returns {Promise<Credentials>}\n * @memberof NativeBiometricPlugin\n * @since 8.4.0\n */\n getSecureCredentials(options: GetSecureCredentialsOptions): Promise<Credentials>;\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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
2
|
import type { PluginListenerHandle } from '@capacitor/core';
|
|
3
|
-
import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, SetCredentialOptions, DeleteCredentialOptions, IsCredentialsSavedOptions, IsCredentialsSavedResult, Credentials, BiometryChangeListener } from './definitions';
|
|
3
|
+
import type { NativeBiometricPlugin, AvailableResult, BiometricOptions, GetCredentialOptions, GetSecureCredentialsOptions, SetCredentialOptions, DeleteCredentialOptions, IsCredentialsSavedOptions, IsCredentialsSavedResult, Credentials, BiometryChangeListener } from './definitions';
|
|
4
4
|
export declare class NativeBiometricWeb extends WebPlugin implements NativeBiometricPlugin {
|
|
5
5
|
/**
|
|
6
6
|
* In-memory credential storage for browser development/testing.
|
|
@@ -13,6 +13,7 @@ export declare class NativeBiometricWeb extends WebPlugin implements NativeBiome
|
|
|
13
13
|
addListener(_eventName: 'biometryChange', _listener: BiometryChangeListener): Promise<PluginListenerHandle>;
|
|
14
14
|
verifyIdentity(_options?: BiometricOptions): Promise<void>;
|
|
15
15
|
getCredentials(_options: GetCredentialOptions): Promise<Credentials>;
|
|
16
|
+
getSecureCredentials(_options: GetSecureCredentialsOptions): Promise<Credentials>;
|
|
16
17
|
setCredentials(_options: SetCredentialOptions): Promise<void>;
|
|
17
18
|
deleteCredentials(_options: DeleteCredentialOptions): Promise<void>;
|
|
18
19
|
isCredentialsSaved(_options: IsCredentialsSavedOptions): Promise<IsCredentialsSavedResult>;
|
package/dist/esm/web.js
CHANGED
|
@@ -38,7 +38,14 @@ export class NativeBiometricWeb extends WebPlugin {
|
|
|
38
38
|
}
|
|
39
39
|
getCredentials(_options) {
|
|
40
40
|
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
41
|
-
|
|
41
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
42
|
+
if (!credentials) {
|
|
43
|
+
throw new Error('No credentials found for the specified server');
|
|
44
|
+
}
|
|
45
|
+
return Promise.resolve(credentials);
|
|
46
|
+
}
|
|
47
|
+
getSecureCredentials(_options) {
|
|
48
|
+
console.log('getSecureCredentials (dummy implementation)', { server: _options.server });
|
|
42
49
|
const credentials = this.credentialStore.get(_options.server);
|
|
43
50
|
if (!credentials) {
|
|
44
51
|
throw new Error('No credentials found for the specified server');
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":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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 GetSecureCredentialsOptions,\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 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 getSecureCredentials(_options: GetSecureCredentialsOptions): Promise<Credentials> {\n console.log('getSecureCredentials (dummy implementation)', { server: _options.server });\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
|
@@ -38,6 +38,26 @@ exports.AuthenticationStrength = void 0;
|
|
|
38
38
|
*/
|
|
39
39
|
AuthenticationStrength[AuthenticationStrength["WEAK"] = 2] = "WEAK";
|
|
40
40
|
})(exports.AuthenticationStrength || (exports.AuthenticationStrength = {}));
|
|
41
|
+
exports.AccessControl = void 0;
|
|
42
|
+
(function (AccessControl) {
|
|
43
|
+
/**
|
|
44
|
+
* No biometric protection. Credentials are accessible without authentication.
|
|
45
|
+
* This is the default behavior for backward compatibility.
|
|
46
|
+
*/
|
|
47
|
+
AccessControl[AccessControl["NONE"] = 0] = "NONE";
|
|
48
|
+
/**
|
|
49
|
+
* Biometric authentication required for credential access.
|
|
50
|
+
* Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).
|
|
51
|
+
* More secure but credentials are lost if user modifies their biometric enrollment.
|
|
52
|
+
*/
|
|
53
|
+
AccessControl[AccessControl["BIOMETRY_CURRENT_SET"] = 1] = "BIOMETRY_CURRENT_SET";
|
|
54
|
+
/**
|
|
55
|
+
* Biometric authentication required for credential access.
|
|
56
|
+
* Credentials survive new biometric enrollment (e.g., adding a new fingerprint).
|
|
57
|
+
* More lenient — recommended for most apps.
|
|
58
|
+
*/
|
|
59
|
+
AccessControl[AccessControl["BIOMETRY_ANY"] = 2] = "BIOMETRY_ANY";
|
|
60
|
+
})(exports.AccessControl || (exports.AccessControl = {}));
|
|
41
61
|
/**
|
|
42
62
|
* Biometric authentication error codes.
|
|
43
63
|
* These error codes are used in both isAvailable() and verifyIdentity() methods.
|
|
@@ -155,7 +175,14 @@ class NativeBiometricWeb extends core.WebPlugin {
|
|
|
155
175
|
}
|
|
156
176
|
getCredentials(_options) {
|
|
157
177
|
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
158
|
-
|
|
178
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
179
|
+
if (!credentials) {
|
|
180
|
+
throw new Error('No credentials found for the specified server');
|
|
181
|
+
}
|
|
182
|
+
return Promise.resolve(credentials);
|
|
183
|
+
}
|
|
184
|
+
getSecureCredentials(_options) {
|
|
185
|
+
console.log('getSecureCredentials (dummy implementation)', { server: _options.server });
|
|
159
186
|
const credentials = this.credentialStore.get(_options.server);
|
|
160
187
|
if (!credentials) {
|
|
161
188
|
throw new Error('No credentials found for the specified server');
|
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 // 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,C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AAI,iBAAiB,CAAC,QAAQ,EAAE;AAChC,QAAQ,OAAO,CAAC,GAAG,CAAC,0CAA0C,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;AAC5F;AACA,QAAQ,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;AACpD,QAAQ,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;;;;;;;;;"}
|
|
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 = {}));\nexport var AccessControl;\n(function (AccessControl) {\n /**\n * No biometric protection. Credentials are accessible without authentication.\n * This is the default behavior for backward compatibility.\n */\n AccessControl[AccessControl[\"NONE\"] = 0] = \"NONE\";\n /**\n * Biometric authentication required for credential access.\n * Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).\n * More secure but credentials are lost if user modifies their biometric enrollment.\n */\n AccessControl[AccessControl[\"BIOMETRY_CURRENT_SET\"] = 1] = \"BIOMETRY_CURRENT_SET\";\n /**\n * Biometric authentication required for credential access.\n * Credentials survive new biometric enrollment (e.g., adding a new fingerprint).\n * More lenient — recommended for most apps.\n */\n AccessControl[AccessControl[\"BIOMETRY_ANY\"] = 2] = \"BIOMETRY_ANY\";\n})(AccessControl || (AccessControl = {}));\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 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 getSecureCredentials(_options) {\n console.log('getSecureCredentials (dummy implementation)', { server: _options.server });\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","AccessControl","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,YAA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,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
|
@@ -37,6 +37,26 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
37
37
|
*/
|
|
38
38
|
AuthenticationStrength[AuthenticationStrength["WEAK"] = 2] = "WEAK";
|
|
39
39
|
})(exports.AuthenticationStrength || (exports.AuthenticationStrength = {}));
|
|
40
|
+
exports.AccessControl = void 0;
|
|
41
|
+
(function (AccessControl) {
|
|
42
|
+
/**
|
|
43
|
+
* No biometric protection. Credentials are accessible without authentication.
|
|
44
|
+
* This is the default behavior for backward compatibility.
|
|
45
|
+
*/
|
|
46
|
+
AccessControl[AccessControl["NONE"] = 0] = "NONE";
|
|
47
|
+
/**
|
|
48
|
+
* Biometric authentication required for credential access.
|
|
49
|
+
* Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).
|
|
50
|
+
* More secure but credentials are lost if user modifies their biometric enrollment.
|
|
51
|
+
*/
|
|
52
|
+
AccessControl[AccessControl["BIOMETRY_CURRENT_SET"] = 1] = "BIOMETRY_CURRENT_SET";
|
|
53
|
+
/**
|
|
54
|
+
* Biometric authentication required for credential access.
|
|
55
|
+
* Credentials survive new biometric enrollment (e.g., adding a new fingerprint).
|
|
56
|
+
* More lenient — recommended for most apps.
|
|
57
|
+
*/
|
|
58
|
+
AccessControl[AccessControl["BIOMETRY_ANY"] = 2] = "BIOMETRY_ANY";
|
|
59
|
+
})(exports.AccessControl || (exports.AccessControl = {}));
|
|
40
60
|
/**
|
|
41
61
|
* Biometric authentication error codes.
|
|
42
62
|
* These error codes are used in both isAvailable() and verifyIdentity() methods.
|
|
@@ -154,7 +174,14 @@ var capacitorCapacitorBiometric = (function (exports, core) {
|
|
|
154
174
|
}
|
|
155
175
|
getCredentials(_options) {
|
|
156
176
|
console.log('getCredentials (dummy implementation)', { server: _options.server });
|
|
157
|
-
|
|
177
|
+
const credentials = this.credentialStore.get(_options.server);
|
|
178
|
+
if (!credentials) {
|
|
179
|
+
throw new Error('No credentials found for the specified server');
|
|
180
|
+
}
|
|
181
|
+
return Promise.resolve(credentials);
|
|
182
|
+
}
|
|
183
|
+
getSecureCredentials(_options) {
|
|
184
|
+
console.log('getSecureCredentials (dummy implementation)', { server: _options.server });
|
|
158
185
|
const credentials = this.credentialStore.get(_options.server);
|
|
159
186
|
if (!credentials) {
|
|
160
187
|
throw new Error('No credentials found for the specified server');
|
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 // 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,YA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AAQ,CAAC,MAAM,CAAC,EAAE,CAAC;IACtF,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 = {}));\nexport var AccessControl;\n(function (AccessControl) {\n /**\n * No biometric protection. Credentials are accessible without authentication.\n * This is the default behavior for backward compatibility.\n */\n AccessControl[AccessControl[\"NONE\"] = 0] = \"NONE\";\n /**\n * Biometric authentication required for credential access.\n * Credentials are invalidated if biometrics change (e.g., new fingerprint enrolled).\n * More secure but credentials are lost if user modifies their biometric enrollment.\n */\n AccessControl[AccessControl[\"BIOMETRY_CURRENT_SET\"] = 1] = \"BIOMETRY_CURRENT_SET\";\n /**\n * Biometric authentication required for credential access.\n * Credentials survive new biometric enrollment (e.g., adding a new fingerprint).\n * More lenient — recommended for most apps.\n */\n AccessControl[AccessControl[\"BIOMETRY_ANY\"] = 2] = \"BIOMETRY_ANY\";\n})(AccessControl || (AccessControl = {}));\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 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 getSecureCredentials(_options) {\n console.log('getSecureCredentials (dummy implementation)', { server: _options.server });\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"],"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