I'm implementing refresh token storage in a mobile app and trying to understand the practical security differences between these two approaches:
Option 1: Hardware-backed storage WITHOUT biometric requirement
- iOS: Keychain with
kSecAttrAccessibleWhenUnlockedThisDeviceOnly - Android: Android Keystore with
setUserAuthenticationRequired(false)
Option 2: Hardware-backed storage WITH biometric requirement
- iOS: Keychain with
SecAccessControlCreateWithFlagsusing.biometryCurrentSet - Android: Android Keystore with
setUserAuthenticationRequired(true)
My understanding is that both options store the token encrypted by hardware (Secure Enclave/TEE), but Option 1 allows retrieval once the device is unlocked, while Option 2 requires biometric authentication for each access.
My specific question: On a non-rooted/non-jailbroken device, with a signed, non-debug app what additional attack vectors does Option 1 expose that Option 2 prevents?
For example, if an attacker has physical access to an unlocked device can they extract tokens from Option 1 using ADB or similar tools?