ionic-team / cordova-plugin-ios-keychain

Apache Cordova (PhoneGap) plugin
Other
62 stars 44 forks source link

Plugin attempts to use TouchID when it shouldn't #5

Closed TomSeldon closed 8 years ago

TomSeldon commented 8 years ago

When setting a key/value and passing false for the useTouchId parameter, the plugin attempts to use TouchID anyway.

i.e.

var useTouchId = false;

Keychain.set(onSuccess, onFail, 'key', 'value', useTouchId);

I would expect this not to try to use TouchId to store the key/value. However if I inspect CDVKeychain.m#set then I can see that on converting the relevant command argument to a boolean it's incorrectly interpreting it as true.

See: screen shot 2016-08-11 at 09 44 58

Is it just expecting a non-boolean argument for `useTouchId, or is it just generally broken?

Also, even if it has been told to use TouchID, shouldn't it ignore that if the device doesn't support it? I believe the plugin may be broken for me due to it trying to save everything with touch ID on a device that doesn't support it (iPad 2 with iOS9).

jacquesdev commented 8 years ago

I have the same issue with an iphone 5s. It seems to ignore setting it to false.

jacquesdev commented 8 years ago

@mlynch - perhaps this is related to the old 'serviceName' 3rd arg being passed into the callback? https://github.com/driftyco/cordova-plugin-ios-keychain/blob/master/www/keychain.js#L29. I would guess it should be removed for all of the methods?

VinKamat commented 8 years ago

I am seeing the same issue - forcing to use touchId although false is passed during the 'set'. Rendering the plugin useless for cases when touchId is not needed.

Any workarounds/solutions to this issue yet?

mlynch commented 8 years ago

didn't mean to close this one. Looking at the issue now

mlynch commented 8 years ago

From what I can see, this appears to happen on the get call rather than the set call. Does that confirm what you're seeing on your end?

mlynch commented 8 years ago

Nevermind I can see this

mlynch commented 8 years ago

Okay, can you try the new release in Master?

Also, make sure you're not trying to grab a key that was stored with TouchID previously, that will force TouchID

raminnoodle commented 8 years ago

Thank you for fixing this. Iv been pulling my hair out all day trying to figure out why it keeps asking for touchid.