SFAuthenticationSession不在真实设备上共享Cookie [英] SFAuthenticationSession isn't sharing cookies on the real devices

查看:76
本文介绍了SFAuthenticationSession不在真实设备上共享Cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将 AppAuth-iOS 用于SSO.一切在ios 11模拟器上都可以正常运行,而SSO(cookie共享)在运行11.0.0、11.0.1、11.0.2的真实设备上无法正常工作.那么SFAuthenticationSession是否损坏了,并且有任何已知的解决方法吗?

I'm using AppAuth-iOS for SSO. Everything works just fine on the ios 11 simulators and SSO (cookies sharing) doesn't work on the real devices running 11.0.0, 11.0.1, 11.0.2. So is the SFAuthenticationSession broken and is there any known workaround?

推荐答案

我也面临着同样的问题,根据我的测试和研究,是的,它已经坏了.SFAuthenticationSessions会记住单个应用程序运行时的cookie,但不会在应用程序重新启动之后或多个应用程序之间(= SSO)记住cookie.我对iOS 11.1 beta 1和Xcode 9.1 beta 1做了一系列测试,结果如下:

I am also facing the same issue and based on my tests and research, yes it is broken. SFAuthenticationSessions remember the cookies on a single application run, but not after the application has restarted or between multiple apps (= SSO). I have done a series of tests with iOS 11.1 beta 1 and Xcode 9.1 beta 1 with following results:

  1. 使用SFAuthenticationSession进行初始登录,并在同一应用程序运行期间,使用另一个SFAuthenticationSession来检查登录是否仍然有效(基于cookie).这样就可以了.
  2. 重新启动应用程序,然后尝试检查会话状态将不起作用,这表明cookie没有持久保存.
  3. 使用系统Safari(带有UIApplication.shared.openURL)进行登录,然后使用SFAuthenticationSession检查登录状态.这也行不通.Safari和SFAuthenticationSession之间不共享Cookie.
  4. 即使在多个应用程序运行之间,也使用系统Safari进行登录和会话检查均有效.与预期的一样,Safari仍会记住其自己的cookie.但是它们没有共享.

我对SFAuthenticationSession的另一个抱怨是使用项目目标名称而不是其弹出对话框的应用程序名称.

The other complaint I have with SFAuthenticationSession is that is uses the project target name and not the application name for its popup dialog.

关于此的唯一正在进行的讨论是在此Twitter帖子中: https://twitter.com/rmondello/status/887434621989789696 .自9月5日以来,我还提交了一个错误报告,但没有任何更新.

The only ongoing discussion I could find about this is in this Twitter post: https://twitter.com/rmondello/status/887434621989789696. I have also filed a bug report but no updates on it since September 5th.

这篇关于SFAuthenticationSession不在真实设备上共享Cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆