Unwanted communication extension - Shared keychain restricted?

I am trying to add Unwanted communication extension extension to my application. But once I try to acces the shared keychain from the extension, it returns me the error code -25291 which is keychain not available.
Note: Keychain sharing is on for the application and is specified in entitlements.