是否可以访问 iOS 钥匙串并获取自动完成字段中存储的密码?
是否可以从 iOS 钥匙串访问用户在 Safari 中提交的已保存密码?
https://developer.apple.com/documentation/security/keychain_services
我想要使用它对某些字段执行自动完成。
Is it possible to access saved passwords that a user has submitted in Safari from the iOS keychain?
https://developer.apple.com/documentation/security/keychain_services
I would like to use it to perform an autocomplete on certain fields.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
现在,这在 iOS 8 中已成为可能。
这是在 WWDC 2014 的一次名为 " 的会议上引入的您的应用程序、您的网站和 Safari”
或者,请参阅这篇文章 了解如何在 Swift 中执行此操作。
简而言之,Web 域 SSL 证书必须由您的 iOS 应用程序进行认证(该应用程序必须具有
关联域
功能)。当两个凭据匹配时,您可以使用SecRequestSharedWebCredential
检索现有的用户名/密码对,或使用SecAddSharedWebCredential
添加新的用户名/密码对或更新现有的用户名/密码对。编辑:Apple 在此处发布了有关如何在 Objective-C 或 Swift 中执行此操作的文档
This is now possible in iOS 8.
This was introduced at WWDC 2014 in a session called "Your App, Your Website, and Safari"
Or, see this post on how to do this in Swift.
In short, the web domain SSL certificate has to be certified by your iOS app (which must have the
associated-domains
capability). When the two credentials match, you can useSecRequestSharedWebCredential
to retrieve existing username/password pairs, orSecAddSharedWebCredential
to add new ones or update existing ones.Edit: Apple has released documentation on how to do this in Objective-C or Swift here
不,这是不可能的。
应用程序只能访问自己的钥匙串,并在其他应用程序钥匙串之间共享。
No, it is not possible.
App could have access only to its own keychain and for shared between your other apps keychains.
请参阅 WWDC 2017 会议,了解有关应用密码自动填充的更多信息。
如果您之前通过 Safari 登录并保存了密码,并且如果您希望在应用程序中使用相同的密码,则单击密码文本字段。此操作将唤醒键盘,键盘将显示按键符号。这对您来说意味着密码是通过 Safari 从保存在钥匙串中的密码列表中自动填充的。因此,单击钥匙符号,身份验证后,您将可以在自动填充密码列表中查看所有保存的密码。
注意:在转到自动填充密码列表之前,您必须使用保存的 touchID 通过本地身份验证来验证您的手机。
See WWDC 2017 session to know more about Password AutoFill for Apps.
If you have logged in earlier through Safari and saved your password and the same password if you wish to use in your app, you click on password textfield. This action will wake a keyboard which will show key symbol. This signifies to you password as an autofill from list of passwords saved in keychain through safari. So click on key symbol, after authentication you will get to view all your saved passwords in Autofill Password List.
Note: Before moving to Autofill Password List you have to authenticate your phone by local authentication using your saved touchID.