SecItemAdd returns errSecAuthFailed

Hello,

I'm experiencing a weird issue on the iOS 15 simulator (unfortunately I don't have a device with 15 installed yet).

The issue I see is that the call to SecItemAdd returns OSStatus -25293 (errSecAuthFailed).

The attributes dictionary passed looks like this:

var query: [String : Any] = [
			kSecClass as String: kSecClassGenericPassword,
			kSecAttrAccount as String: key,
			kSecAttrService as String: service,
			kSecAttrAccessControl as String: getSecAccessControl(),
			kSecUseAuthenticationContext as String: context,
			kSecValueData as String: data
        ]

the getSecAccessControl returns a SecAccessControl created like this:

        access = SecAccessControlCreateWithFlags(nil,
			  kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
			  .userPresence,
			  &error)

if I do not add the kSecAttrAccessControl item I don't see any error.

The same code works as expected on the simulator with iOS 14. Looking at the documentation didn't help, anybody has hints about this? Maybe it's bug I'm not aware of?

Thank you in advance

Haven't heard anything from Apple support since filing a bug report.

Any updates about the issue ?

I'm still facing the same issue on iOS 15.2 simulator. But it seems that it has been fixed on the iOS 16.0 beta 1 simulator

it seems that it has been fixed on the iOS 16.0 beta 1 simulator

Cool. That matches my expectations based on the info in FB9777739.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

SecItemAdd returns errSecAuthFailed
 
 
Q