XcodeUpdates icon indicating copy to clipboard operation
XcodeUpdates copied to clipboard

SecItemAdd [-25308 errSecInteractionNotAllowed] User interaction is not allowed

Open art-divin opened this issue 5 years ago • 4 comments

Note: this is a duplicate of my TSI ticket, this issue will be updated along w/ the received feedback.

When I create an XPC service And that XPC service runs a command line tool via NSTask API And that command line tool tries to use SecItemAdd to store an item in Keychain Then I receive -25308 error which is errSecInteractionNotAllowed in Keychain API reference

However, when there's no XPC service between Main app (UI) and command line tool, then SecItemAdd works as expected (i.e. NSTask is run from the app that user has launched comparing to XPC service that was launched with launchd)

art-divin avatar Jan 04 '21 12:01 art-divin

Follow-up of dev forums: https://developer.apple.com/forums/thread/670702

art-divin avatar Jan 04 '21 13:01 art-divin

Received feedback, will try things out. Will keep you posted!

art-divin avatar Jan 07 '21 05:01 art-divin

Did a workaround, a lot of progress. Soon the Release!

art-divin avatar Jan 13 '21 18:01 art-divin

https://developer.apple.com/forums/thread/114159

add kSecAttrAccessibleAlways to kSecAttrAccessible will fix this bug.

I-m-SuperMan avatar Apr 22 '21 08:04 I-m-SuperMan