【问题标题】:How to sign-out with SFAuthenticationSession如何使用 SFAuthenticationSession 注销
【发布时间】:2018-11-07 23:52:16
【问题描述】:

我使用 SFAuthenticationSession 通过 SSO 登录到 login.microsoftonline.com。它工作得很好,但是注销存在问题。 SFAuthenticationSession 不提供清除 cookie 的方法。因此,当我再次调用 SFAuthenticationSession.start() 时,我会获得带有身份验证令牌的先前回调 url,而不是允许用户提供新凭据。

作为一种解决方法,我用SFAuthenticationSession.start() 调用login.microsoftonline.com/common/oauth2/logout。它有效,但 UX 体验比糟糕还糟糕。

真的没有其他方法可以用SFAuthenticationSession 清除cookie吗?会话不与 Safari 共享,因此打开 web 视图也不起作用。

ASWebAuthenticationSession 代替 SFAuthenticationSession 是否允许以某种方式清除 cookie?

我知道已经在 SO 上提出了非常相似的问题,但也许有关于这个主题的一些更新。

【问题讨论】:

    标签: ios swift oauth alamofire aswebauthenticationsession


    【解决方案1】:

    注销的唯一方法是调用 login.microsoftonline.com/common/oauth2/logout 或者如果您想在应用程序之间使用 sso,您可以使用 WKWebView,但如果您想使用 sso在 Safari 和您的应用程序之间,唯一的方法是 ASWebAuthenticationSession 或 SFAuthenticationSession。 ASWebAuthenticationSession 与 SFAuthenticationSession 相同,但它们添加了权限警报视图,当您需要注销时,用户将看到带有问题的警报视图:您要登录吗?希望苹果能修复它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-14
      • 1970-01-01
      • 2020-10-20
      • 2021-03-23
      • 1970-01-01
      • 2021-07-30
      • 1970-01-01
      • 2018-01-14
      相关资源
      最近更新 更多