[英]Keychain access in iOS for OAuth tokens
I'd like to use Keychain Services
for iOS to store the OAuth access token and refresh token that my app need to perform Web services requests. 我想使用适用于iOS的
Keychain Services
来存储OAuth访问令牌并刷新我的应用程序执行Web服务请求所需的令牌。 I've been reading the Keychain Services Programming Guide and I downloaded the GenericKeychain sample code, but I'm getting confused: 我一直在阅读《 钥匙串服务编程指南》,并下载了GenericKeychain示例代码,但我感到困惑:
Data Protection
in Member Center for the App ID and its associated provisioning profile. Data Protection
。 However, I didn't read anything about enabling Data Protection
in Xcode for the target's capabilities, and it seems that I could access the keychain anyway... this is weird, but I guess I should enable Data Protection
in the Xcode project as well, right? Data Protection
以实现目标功能的任何信息,而且看来我仍然可以访问钥匙串……这很奇怪,但是我想我也应该在Xcode项目中启用Data Protection
。 , 对? Where is this Data Protection
stuff described in Apple's docs? Data Protection
内容在哪里? Is it somewhere said that I need to enable it for Keychain
management? Keychain
管理启用它? I don't find it... kSecClassGenericPassword
class for the keychain items. kSecClassGenericPassword
类用于钥匙串项目。 Since I want to manage OAuth related information, is there any better class I should use? kSecClassInternetPassword
? kSecClassInternetPassword
吗? What is the difference with kSecClassGenericPassword
? kSecClassGenericPassword
什么区别? KeychainWrapper
class, or would it be better to access keychain related methods as class methods? KeychainWrapper
类,还是最好将与钥匙串相关的方法作为类方法来访问? Thanks in advance 提前致谢
Q3: According to Apple Q3:据苹果
documentation 文件资料
You use Internet passwords for accessing servers and websites over the Internet, and generic passwords for any other password-protected service (such as a database or scheduling application).
您使用Internet密码来通过Internet访问服务器和网站,并使用通用密码来访问任何其他受密码保护的服务(例如数据库或调度应用程序)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.