setPassword:forService doesn't update old keys #11
Comments
It definitely does. I've used it in dozens of applications and this is tested in the unit tests. My guess is there is a keychain issue unrelated to SSKeychain. Are you on Mac or iOS? Don't get me wrong, there could be a bug, but I do this really often. If you can post a simple test app that reproduces it, that would also help. On Sep 17, 2012, at 3:20 PM, Kilian Ciuffolo notifications@github.com wrote:
|
I will post here a sample app. I will be happy to discover that the problem is in my code :) P.S. yes I am on mac. |
I think I got the same problem, the new value isn't saved to keychain. jun1st.feng@gmail.com On Tuesday, September 18, 2012 at 3:49 PM, Kilian Ciuffolo wrote:
|
I've seen lots of issues on Mac. It's likely due to a code signing issue or of you're using Developer ID, there are a lot of known issues. See http://samsoff.es/posts/developer-id-and-10-8 Sam On Sep 18, 2012, at 4:09 AM, Derek notifications@github.com wrote:
|
Having the same issue on 10.8.2, not using code signing or developer ID. Replacing the password doesn't work nor does deleting and adding again. Here's a Gist of my code: https://gist.github.com/3925465 In this case the logging statement on line 17 will print the original password instead of nil. Setting the password again on line 21 has no effect. |
Any update/workaround on this, that's really annoying :( @soffes still need my project? I can send it to you. |
Sure. Like I said before, I am 90% sure this is a bug in Keychain and not in SSKeychain. If you can provide a reproducible example project I can do some investigation. |
Code: if ([SSKeychain setPassword:[credentials valueForKey:@"password"] forService:@"myservice" account:[credentials valueForKey:@"login"] error:&e])
NSLog(@"Password for %@ is stored in keychain", [credentials valueForKey:@"login"]);
else NSLog(@"Can't store the password in keychain, error:%@", [e localizedDescription]); Log:
Error 25299 from Security framework: errSecDuplicateItem = -25299, /* The specified item already exists in the keychain. */ But when i delete username from keychain manually, it saves the password. So the problem is in updating already presented keys. P.S. In fact, [deletePassword] return YES, but the password is kept in keychain :( |
You mean the password is kept in keychain even if you delete it? |
Exactly! |
I've seen this before. It was a code signing issue that caused all writes to fail. SSKeychain should have better support for errors (but if I remember correctly, the Security APIs didn't return any when this is the issue). I think it was an issue with Developer ID. I had to build on 10.7 to fix. I'm going to close this since it's a Keychain issue and not an SSKeychain issue. |
I encountered this issue building on Mac OS 10.7 for Mac OS 10.6. In the past I've worked around this by modifying the existing item with SecKeychainItemModifyAttributesAndData like in this code. I'm going to try to modify SSKeychain to do the same. |
Great work fixing the delete password for OSX @paulmelnikow - thanks! |
It does work the first time, then it doesn't update the same key.
The text was updated successfully, but these errors were encountered: