且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何以编程方式允许我的应用程序访问KeyChain?

更新时间:2023-12-03 20:22:40

该对话框是钥匙串的安全功能.因为它存储敏感的用户信息,所以OS采取的立场是,用户应始终可以选择阻止使用此信息,以便用户可以信任自己在不知情的情况下未被使用.

The dialog box a security feature of the keychain. Because it stores sensitive user information, the OS takes the position that the user should always have the option to prevent the use of this information so that the user can trust they're not being used without their knowledge.

因此,没有办法阻止显示安全对话框.如果您代码签名,则可以使用户的生活更轻松.当您更新已签名的应用程序应用程序时,Mac OS X将识别出它是同一应用程序,并且如果他们决定始终允许访问其凭据,则不会再次提示您的用户.

So no, there's no way to prevent the security dialog box from being shown. You can make your user's life easier if you code sign your application. When you update a signed app app, Mac OS X will recognize that it's the same app and won't prompt your user again if they've decided to always allow access to their credentials.