How to enable keychain sharing with Siri kit extension?

試著忘記壹切 提交于 2019-12-11 04:52:21

问题


I want to enable keychain sharing between my app and sirikit extension. I have added keychain access group with same string for app and sirikit. Also added App group for both the targets with same string. I am using Locksmith as a keychain wrapper, which is also using the kSecAttrAccessGroup property with the value teamID + keychain access group ID. But I am getting the following error when I try to run from siri extension:

CredStore - performQuery - Error copying matching creds.  Error=-25300, query={class = inet;
        "m_Limit" = "m_LimitAll";
        ptcl = htps;
        "r_Attributes" = 1;
        srvr = "appurl.com";
        sync = syna;
    }

Any guidance is appreciated. Thank you


回答1:


The reason it was not working because the TeamID or AppIdentifierPrefix was different in the provisioning profile the app and the siri extension was using. When we us the keychain access group, if you check the entitlements the keychain access group is prefixed with AppIdentifierPrefix which is the TeamID or AppID that is attached with your account:

<key>keychain-access-groups</key>
<array>
    <string>$(AppIdentifierPrefix)common_keychain_access_group_string</string>
</array>

And this AppIdentifierPrefix must be same for both the app and sirikit. Thank you



来源:https://stackoverflow.com/questions/51163065/how-to-enable-keychain-sharing-with-siri-kit-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!