9

I store username & password using keychain, sometimes when I tried to get the password of the username, it told me errSecItemNotFound.

I keep that the password is always existed in keychain, so why it is not found?

Thanks.

Jason Lee
  • 3,200
  • 1
  • 34
  • 71
  • Something I encountered is as follows. User name get first letter capitalized due to misconfiguration of email field. Ex. Manik@example.com. But when I make api request backend save it as madnik@example.com and I save Madnik@example.com in the in keychain as account but I try to delete madnik@example.com when logout. Silly mistake. Hope this help someone. – MadNik Aug 03 '15 at 08:21

3 Answers3

1

Tony: that error is simply OSStatus error -34018 - client has neither application-identifier nor keychain-access-groups entitlements.

This could be happening as a result from using a nonstandard app signing method or some other problem with your entitlements. Make sure you're building simply out of Xcode and not using alternate signing methods unless you completely understand them.

russellm
  • 155
  • 7
  • I see that keychain access groups entitlements a re not being set, since no access group is required. However how can there be no application-identifier? What does that mean anyways? And yes I'm simply letting xcode handling the signing. – Tony Nov 27 '13 at 00:16
  • Are you using a wildcard appid instead of a specific appid? – russellm Nov 27 '13 at 01:59
  • 1
    should be a specific app id. Strange thing is error can never be consistently reproduced. – Tony Nov 27 '13 at 20:29
0

When reading the keychain, make sure you always build with a provisioning profile linked with the appId that used to create the keychain record.

graver
  • 15,183
  • 4
  • 46
  • 62
0

@graver

http://opensource.apple.com/source/Security/Security-55471/sec/Security/SecBasePriv.h

errSecMissingEntitlement = -34018, /* Internal error when a required entitlement isn't present. */

sktree
  • 101
  • 5