ios - 有没有办法在显示 SFAuthenticationSession 提示之前知道是否有可用的 cookie

标签 ios authentication oauth ios11 sfauthenticationsession

在 iOS 11 上,Apple 引入了一种通过 SFAuthenticationSession 在 Web 和移动应用程序之间共享身份验证数据的新方法。

向每个新用户(可能从未使用过我的网站)显示 SFAuthenticationSession 提示让他们同意然后什么也得不到并询问他们将是糟糕的用户体验登录。

documentation苹果方面很空。这是唯一的 example我找到了。

有没有办法知道显示SFAuthenticationSession 提示符之前是否有可用的cookie?或者,在启用 Associated Domains 的情况下,当使用我的域进行身份验证时,系统不应显示提示?

最佳答案

没有。即使没有 cookie,用户也可以输入用户名/密码登录,然后在网站(例如:Facebook、Instagram)上单击“登录”/“输入”。

访问 cookie 将不会被启用:

When the webpage is presented, it runs in a separate process, so the user and web service are guaranteed that the app has no way to gain access to the user’s credentials. Instead, the app gets a unique authentication token. Official docs

Instagram-OAuth 的工作示例:https://github.com/dvdhpkns/SFAuthenticationSession-Instagram-Oauth


您添加的 GitHub 存储库是由作者发布的,用于发送有关本地服务器 cookie 共享错误的错误报告 (rdar://33418129.Original tweet)

Are cookies shared between Safari and SFAuthenticationSession? @DVDHPKNS

They’re supposed to be shared, but we have some timing bugs right now. Please do file bugs about what you’re seeing. @rmondello (Apple employee)

P.S:自您的原始发布日期以来,他们向文档中添加了更多信息。

关于ios - 有没有办法在显示 SFAuthenticationSession 提示之前知道是否有可用的 cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45245918/

相关文章:

ios - SIGSEGV 和 SIGBUS 使用 Xamarin.iOS 统一 API 崩溃

perl - 在脚本中使用 Bugzilla Perl API 时如何进行身份验证?

oauth - 如何使用 rest api 调用获取 Openshift session token

iphone - 使用 UISwipeGestureRecognizer 滑动 View

ios - Swift 正确声明对应于协议(protocol)并具有父类(super class)的对象

iphone - 图片命名约定困惑与UIBarButtonItem

php - 单纯用户的登录控制和管理面板加密

php - 在 PHP 中使用 CURL 将登录 POST 到远程 auth 函数/php 文件

c# - 如何在 ASP.NET Core RC1 中使用 Facebook 提供程序获取其他字段?

oauth - 在 .NET WCF Web API 上处理身份验证的最佳方法