iphone - 用新的 iOS 5 Accounts.framework 替换用户名/密码

标签 iphone objective-c ios oauth ios5

iOS 5 release notes提到了Accounts.framework:

Accounts Framework The Accounts framework (Accounts.framework) provides a single sign-on model for certain user accounts. Single sign-on improves the user experience, because applications no longer need to prompt a user separately for login information related to an account. It also simplifies the development model for you by managing the account authorization process for your application. In iOS 5.0, applications can use this framework in conjunction with the Twitter framework to access a user’s Twitter account.

For more information about the classes of the Accounts framework, see Accounts Framework Reference.

据我了解,这并不相当于Mac上的钥匙串(keychain),它可以存储用户名和密码,但它使用 OAuth它似乎使用 token 进行身份验证,而不是用户名和密码。

现在我不确定的点是:

  1. 如果我想使用帐户框架,我是否必须更改服务器后端的身份验证机制。如果是,我是否需要在服务器端安装某种 OAuth 插件?

  2. 假设是这种情况,并且我可以控制服务器后端,我必须如何处理密码,以便将其存储在帐户框架中。

  3. 帐户是否与 iCloud 兼容,这样如果我在 iPad 上登录,我也可以自动在 iPhone 上登录。

最佳答案

这里的关键是

In iOS 5.0, applications can use this framework in conjunction with the Twitter framework to access a user’s Twitter account.

目前,您无法将帐户框架用于您自己的帐户。它仅用于 Twitter 框架。它是一个独立的框架,因此将来可以开放用于此类用途(或 Apple 提供的任何进一步集成,例如 Facebook)。

关于iphone - 用新的 iOS 5 Accounts.framework 替换用户名/密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8880999/

相关文章:

iphone - 如何从 NSData 获取信息?

objective-c - 在 Objective-C 中接收原始以太网帧

ios - 确定 valueForKeyPath 异常的原因

iOS:背景颜色——UITableView 和 Accessory 具有相同的背景颜色

ios - 如何在2个NSManagedObjectContext之间复制对象

ios - MFSideMenuContainerViewController 在 iphone sdk 中不起作用

ios - 将 UIViewController 的 UI 扩展到子 UIViewController

ios - 如何在iOS中实现Android的getViewById?

iphone - 为什么会出现 NSException 错误?

ios - 使用 ionic 媒体插件在 IOS 上录制语音笔记不起作用