Hi,
In my app I want to initiate device passcode authentication. (No need of touch ID, so not using Local authentication). For that I am adding the below query to keychain
kSecClass: kSecClassGenericPassword,
kSecAttrAccessControl: secAccessControlbject,
kSecAttrService: "PasscodeAuthentication",
kSecValueData: dataToStore as Any,
]
SecItemAdd(insertQuery as CFDictionary, nil)
Then at the point where I want to initiate passcode authentication calling bellow method:
let status: OSStatus = SecItemCopyMatching(query, &typeRef)
This was working fine.
But When I initiate method to get the query from a closure it is not working and trowing error code -25293.
If I add a delay before calling this method it is working fine.
Why this is happening ?