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)
Code is available here: https://github.com/art-divin/XcodeUpdates/tree/feature/issue-6
While running, one can notice that there's an error when the app tries to write an item to Keychain.
TSI #757702091
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)
Code is available here: https://github.com/art-divin/XcodeUpdates/tree/feature/issue-6
While running, one can notice that there's an error when the app tries to write an item to Keychain.
TSI #757702091