KeychainAccess icon indicating copy to clipboard operation
KeychainAccess copied to clipboard

TouchID not showed after .removeAll()

Open carmelogallo opened this issue 7 years ago • 4 comments

Hi guys, I got this weird issue. Seems that if I call

do {
    try Keychain(service: "XXX").removeAll()
} catch let error {
    Manager.log.error("Failed to remove all keychains with error: \(error)")
}

and after

let keychain = Keychain(service: "XXX")
DispatchQueue.global(qos: DispatchQoS.QoSClass.default).async {
    do {
        // Should be the secret invalidated when passcode is removed? If not then use '.WhenUnlocked'
        try keychain
            .accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
            .authenticationPrompt("Authenticate to update your access token")
            .set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
    } catch let error {
        // Error handling if needed...
    }
}

the touch id pop up is not showed but, if you call it again the pop up is showed. Seems that the first time you try to access to touch id after .removeAll() is broken. Any clue why?

[UPDATED] ~~Seems that calling any Keychain feature in application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool fail the touch id. I was calling the .removeAll() there but even if I set a key there the touch id fails.~~ The problem is always there if I use .removeAll() in any place. Also if you set a key in application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool the touch id fails as well.

carmelogallo avatar Mar 01 '17 11:03 carmelogallo

Same thing here, couldn't figure out why

txaiwieser avatar Mar 01 '17 15:03 txaiwieser

@kishikawakatsumi may you help out here?

carmelogallo avatar Mar 01 '17 15:03 carmelogallo

Hi, I'm having the same issue with the "remove" method also. Next time I'm adding an item, the TouchId popup won't show.

Claes34 avatar Jan 27 '20 16:01 Claes34

Any updates on this?

vg-identance avatar Jul 09 '20 09:07 vg-identance