How to associate Touch ID with registration data?

I can successfully verify the Touch Touch ID. However, what is the safest way to get a user login and password to log in after successfully identifying a touch identifier identifier.

For the iTunes connect application, once the login with the touch ID is successful, it seems that it will retrieve the password locally and fill it in the UITextField password. I guess it uses a keychain.

However, is it possible to store user credentials on the iPhone itself? Are there any other methods?

enter image description here

+7
ios iphone xcode keychain touch-id
source share
1 answer

You want to save information for entering the keychain, but you need to make sure that the accessibility parameter is set to kSecAttrAccessibleWhenUnlocked or kSecAttrAccessibleWhenUnlockedThisDeviceOnly (kSecAttrAccessibleWhenUnlockedThisDeviceOnly is a bit safer, since the device doesn’t leave your laptop).

NSMutableDictionary *query = [NSMutableDictionary dictionary]; [query setObject:(id)kSecClassGenericPassword forKey:(id)kSecClass]; [query setObject:account forKey:(id)kSecAttrAccount]; [query setObject:(id)kSecAttrAccessibleWhenUnlocked forKey:(id)kSecAttrAccessible]; [query setObject:[inputString dataUsingEncoding:NSUTF8StringEncoding] forKey:(id)kSecValueData]; OSStatus error = SecItemAdd((CFDictionaryRef)query, NULL); 

(Code from http://software-security.sans.org/blog/2011/01/05/using-keychain-to-store-passwords-ios-iphone-ipad/

+4
source share

All Articles