Class AuthenticationOptions
java.lang.Object
com.codename1.security.AuthenticationOptions
Configures a single call to Biometrics.authenticate(AuthenticationOptions).
Setters return this for fluent chaining; only setReason(String) is
required (it maps to the iOS localizedReason and the Android
BiometricPrompt title fallback).
Not every option is honoured on every platform -- the docs on each
setter note where the value is consulted. Unrecognised options are
silently ignored, so callers can set the union without
platform-checking. On platforms that don't support biometrics at all
(desktop deploy, JavaScript), the entire prompt collapses into a
BiometricError.NOT_AVAILABLE failure and none of these options matter.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe current AndroidBiometricPromptdescription body, ornullif unset.The current AndroidBiometricPromptnegative button label.The current prompt reason, ornullif unset.The current AndroidBiometricPromptsubtitle, ornullif unset.getTitle()booleantruewhen the OS prompt is configured to reject device-credential fallback.booleantruewhen the caller has asked for a class-3 ("strong") biometric.booleantrue(the default) when Codename One should overlay its own dialog on the legacy AndroidFingerprintManagerpath.booleantruewhen the Android sticky-auth flag is set.setBiometricOnly(boolean biometricOnly) Iftrue, the OS prompt rejects device-credential fallback (PIN / pattern / passcode).setDescription(String description) AndroidBiometricPromptdescription body.setNegativeButtonText(String text) AndroidBiometricPromptnegative button label (defaults to"Cancel").The user-facing reason for prompting.setSensitiveTransaction(boolean sensitive) Hints that the operation guards a sensitive action and a class-3 ("strong") biometric should be required where the platform exposes the distinction.setShowDialogOnAndroid(boolean show) Controls whether the legacyFingerprintManagerpath (Android 6-9) draws a Codename One Dialog over the system prompt.setStickyAuth(boolean stickyAuth) Iftrue, the in-progress authentication survives the app being backgrounded and resumes on foreground (Android sticky-auth semantics).setSubtitle(String subtitle) AndroidBiometricPromptsubtitle.AndroidBiometricPrompttitle.
-
Constructor Details
-
AuthenticationOptions
public AuthenticationOptions()
-
-
Method Details
-
getReason
The current prompt reason, ornullif unset. SeesetReason(String)for how it is rendered. -
setReason
The user-facing reason for prompting. On iOS this is thelocalizedReasonpassed toLAContext.evaluatePolicy; on Android it is used as theBiometricPrompttitle ifsetTitle(String)is unset. On JavaSE simulator it is shown in the modal prompt body. Required for production use -- platforms typically reject an empty reason. -
getTitle
The current AndroidBiometricPrompttitle, ornullto fall back togetReason(). Alwaysnullon iOS where this property has no effect. -
setTitle
AndroidBiometricPrompttitle. Ignored on iOS (usesetReason(String)there). Ignored on the fallback base class. -
getSubtitle
The current AndroidBiometricPromptsubtitle, ornullif unset. Alwaysnullon iOS where this property has no effect. -
setSubtitle
AndroidBiometricPromptsubtitle. Ignored on iOS and on the fallback base class. -
getDescription
The current AndroidBiometricPromptdescription body, ornullif unset. Alwaysnullon iOS where this property has no effect. -
setDescription
AndroidBiometricPromptdescription body. Ignored on iOS and on the fallback base class. -
getNegativeButtonText
The current AndroidBiometricPromptnegative button label. Defaults to"Cancel". Ignored on iOS (Apple's prompt has its own system-defined cancel button). -
setNegativeButtonText
AndroidBiometricPromptnegative button label (defaults to"Cancel"). Ignored on iOS and on the fallback base class. -
isBiometricOnly
public boolean isBiometricOnly()truewhen the OS prompt is configured to reject device-credential fallback. SeesetBiometricOnly(boolean). -
setBiometricOnly
Iftrue, the OS prompt rejects device-credential fallback (PIN / pattern / passcode). Honoured on both platforms; on Android this maps tosetAllowedAuthenticators(BIOMETRIC_STRONG)or its legacy equivalent. Ignored on the fallback base class. -
isSensitiveTransaction
public boolean isSensitiveTransaction()truewhen the caller has asked for a class-3 ("strong") biometric. SeesetSensitiveTransaction(boolean). -
setSensitiveTransaction
Hints that the operation guards a sensitive action and a class-3 ("strong") biometric should be required where the platform exposes the distinction. Affects Android API 30+; advisory on iOS (where Face ID / Touch ID are both considered strong). Ignored on the fallback base class. -
isStickyAuth
public boolean isStickyAuth()truewhen the Android sticky-auth flag is set. SeesetStickyAuth(boolean). -
setStickyAuth
Iftrue, the in-progress authentication survives the app being backgrounded and resumes on foreground (Android sticky-auth semantics). No effect on iOS or on the fallback base class. -
isShowDialogOnAndroid
public boolean isShowDialogOnAndroid()true(the default) when Codename One should overlay its own dialog on the legacy AndroidFingerprintManagerpath. SeesetShowDialogOnAndroid(boolean). -
setShowDialogOnAndroid
Controls whether the legacyFingerprintManagerpath (Android 6-9) draws a Codename One Dialog over the system prompt. The modernBiometricPromptpath (Android 10+) provides its own UI and ignores this flag. Ignored on iOS and on the fallback base class.
-