Problems using keychain in macOS Content Blocker extensions

Problems using keychain in macOS Content Blocker extensions

We are developing Content Blocker app for macOS Safari Extension.

Use the keychain within the Content Blocker extension.

But there is a problem.

If you try to read information from a keychain, you will get the following error:

Error Domain = com.eeaapps.ahkeychain Code = -25308 "User interaction is not allowed." UserInfo = {NSLocalizedDescription = User interaction is not allowed.}



There is no problem with the keychain in other extensions.

Even the iOS version of Content Blocker had no problems.

But is it impossible to use keychain within the Content Blocker of macOS?

Replies

I've also encountered this issue. My app, Safari app extension, and content blocker extension share code that accesses the macOS keychain. My content blocker can't access the keychain, but my other two processes can.


My extension allows users to whitelist websites for the content blocker. Because of this, I'm trying to avoid storing my blocklist JSON in plaintext. I'd planned to encrypt this using keys stored in the keychain, but that appears to be a non-starter.


What alternative options do I have to achieve this goal?