-
Notifications
You must be signed in to change notification settings - Fork 232
feat: add configurable biometric authentication policies #1411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add configurable biometric authentication policies #1411
Conversation
|
Claude finished @subhankarmaiti's task —— View job Code Review Complete
Overall Assessment❌ This PR introduces valuable biometric authentication policy functionality but has several issues that should be addressed before merging, including a critical platform inconsistency, missing input validation, documentation accuracy concerns, and a typo in the example code. Key Issues Identified:
Positive Aspects:
|
android/src/main/java/com/auth0/react/LocalAuthenticationOptionsParser.kt
Outdated
Show resolved
Hide resolved
android/src/main/java/com/auth0/react/LocalAuthenticationOptionsParser.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds configurable biometric authentication policies to react-native-auth0, enabling developers to control when biometric prompts appear when accessing stored credentials. The feature provides four policy options (default, always, session, and appLifecycle) with configurable timeout support, bringing parity with the native Auth0.Android and Auth0.swift SDKs.
Key Changes:
- Introduced
BiometricPolicyenum with four policy types for controlling biometric authentication prompt behavior - Extended
LocalAuthenticationOptionsinterface withbiometricPolicyandbiometricTimeoutproperties - Updated native iOS and Android implementations to support the new biometric policies, including dependency upgrades to Auth0 2.16 (iOS) and Auth0.android 3.12.0 (Android)
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/types/platform-specific.ts |
Added BiometricPolicy enum and extended LocalAuthenticationOptions interface with biometric policy and timeout properties |
src/specs/NativeA0Auth0.ts |
Updated native module type definitions to include biometricPolicy and biometricTimeout fields |
src/index.ts |
Exported BiometricPolicy enum as a value alongside other enums |
src/exports/enums.ts |
Added BiometricPolicy to enum exports |
ios/NativeBridge.swift |
Implemented biometric policy parsing and conversion logic for iOS |
android/src/main/java/com/auth0/react/LocalAuthenticationOptionsParser.kt |
Implemented biometric policy parsing and mapping to Android SDK policies |
android/build.gradle |
Updated Auth0.android dependency from 3.11.0 to 3.12.0 |
A0Auth0.podspec |
Updated Auth0 iOS dependency from 2.14 to 2.16 |
example/ios/Podfile.lock |
Updated iOS dependency lock file with Auth0 2.16.0 and checksums |
example/src/navigation/RootNavigator.tsx |
Added lazy loading for demo navigators with Suspense to defer Auth0Provider initialization |
example/src/navigation/MainTabNavigator.tsx |
Removed Api tab screen import and navigator entry |
example/src/navigation/HooksDemoNavigator.tsx |
Added comprehensive usage examples demonstrating all biometric policy options |
example/src/screens/hooks/Api.tsx |
Removed redundant API test screen |
EXAMPLES.md |
Added comprehensive documentation section covering biometric authentication policies, usage examples, and platform-specific behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR introduces configurable biometric authentication policies for react-native-auth0, inheriting functionality from Auth0.Android (#867) and Auth0.swift (#1019, #1028).
New Features
Added
BiometricPolicyenum with 4 policy types:default: System-managed behavior (backward compatible)always: Always prompts for biometric authenticationsession: Prompts once per session with configurable timeoutappLifecycle: Prompts once per app lifecycle with configurable timeoutExtended
LocalAuthenticationOptionsinterface with:biometricPolicy?: BiometricPolicybiometricTimeout?: number(default: 3600 seconds)Related Issues
Resolves #687