I am using SSKeychain as a wrapper to store a user's access token and user ID.
I make a web request for my user's access token during sign up and then I call
[SSKeychain setPassword:@"password" forService:@"myService" account:@"myAccount"]
However, when I attempt to access the password with [SSKeychain passwordForService:@"myService" account:@"myAccount" error:&error]
, I get nil and when I log the error, I get errSecDefault.
I've done some online research on the errSecDefault, and I've checked out SSKeychain's documentary as well as issues on github. It seems like other's have the same problem, but I haven't found any solution. It also seems to be something inherent to Keychain, and not the wrapper, (based on what i've read from the issue threads).
Has anyone encountered this error using the keychain and figured out how what it even means?
I encountered the same issue because I accessed the keychain too often. Like userdefaults it's not a datastorage.
I wrote a wrapper that locally saved the token in a variable and only accessed the keychain when changes where made and otherwise returned the locally saved token/password. That solved it for me.