BiometricAuthenticatorConfig
Configuration class for biometric authenticators that defines UI prompts, key generation, and hardware preferences.
This DSL-style configuration class provides comprehensive control over biometric authentication behavior, including user interface presentation, cryptographic key generation parameters, and hardware security preferences. The configuration follows a builder pattern allowing flexible customization while providing sensible defaults for most biometric authentication scenarios.
Key configuration areas:
UI Presentation: Customizable biometric prompt appearance and messaging
Key Generation: Hardware-backed cryptographic key parameters and specifications
Hardware Preferences: StrongBox support and security enclave utilization
Logging: Configurable logging for debugging and monitoring biometric operations
Biometric Management: Integration with Android BiometricManager APIs
Default configuration provides:
Standard logging through the SDK logger
Software-backed key generation (StrongBox disabled by default)
Empty prompt configuration (requires customization)
Default Android Keystore key generation parameters
Automatic BiometricManager initialization
Example usage:
val authenticator = BiometricOnlyAuthenticator {
strongBoxPreferred = true
promptInfo {
setTitle("Authenticate with Biometric")
setSubtitle("Use your fingerprint or face")
setDescription("This verifies your identity for secure access")
setNegativeButtonText("Cancel")
}
keyGenParameterSpec {
setUserAuthenticationRequired(true)
setUserAuthenticationValidityDurationSeconds(0) // Require auth for each use
setInvalidatedByBiometricEnrollment(true)
}
logger = Logger.create("BiometricAuth")
}Security considerations:
StrongBox provides highest security but limited device support
Key invalidation on biometric changes prevents unauthorized access
User authentication requirements ensure fresh biometric verification
Logging should be disabled or filtered in production builds
Hardware compatibility:
Requires Android 6.0+ (API 23) for basic biometric support
Android 9.0+ (API 28) recommended for BiometricPrompt APIs
StrongBox requires Android 9.0+ and compatible hardware
Biometric sensors (fingerprint, face, iris) must be available
Since
1.0.0