Facebook 用户访问令牌是否在重新安装时刷新?

Is Facebook User Access Token refreshed on reinstall?

假设我有一个 iOS 应用程序,链接到 Facebook 应用程序。我对以下内容感兴趣,但是,docs 是矛盾的(不幸的是,我无法自己测试):

假设用户通过我的 iOS 应用链接到 Facebook。假设安装的应用知道与 Facebook 的连接(Facebook ID 和 Facebook 用户访问令牌)。到目前为止,还不错。

从我认识的人那里听说,如果卸载 iOS 应用程序,重新安装它并尝试使用 Facebook 登录,Facebook 用户访问令牌将被重新创建。

但这似乎在逻辑上存在缺陷,因为:

因此,从逻辑上讲,我假设 Facebook 用户访问令牌应该是可移植的,也就是说,在用户卸载 iOS 应用程序、重新安装它并尝试连接 Facebook 之后,应该可以使用一个函数来收集 Facebook 用户访问令牌,因为它在逻辑上应该链接到用户,而不是设备。我是对还是错?如果正确,当用户(重新)安装应用程序时,如何重新收集 Facebook 用户访问令牌?如果错了,我的推理有缺陷吗?

if one uninstalls the iOS application, reinstalls it and tries to log in with Facebook, the Facebook User Access Token is recreated

创建了一个 new Facebook 用户访问令牌。在用户更改密码之前,旧令牌仍然有效。

if the Facebook User Access Token is (re)generated upon logging in with Facebook, then the scenario of installing the app on a second device would render the connection of the first device unusable

因为它是生成的而不是重新生成的,所以它按预期工作。用户可以连接多台设备以使用 Facebook iOS。

If the Facebook User Access Token is invalidated upon the uninstallation of the iOS app

嗯,这不是前面所说的。

when the app is installed on two devices, uninstalling it from a device would render the connection to the second device unusable

见上文。

the Facebook User Access Token should be portable,

正确。该令牌是可移植的,我可以使用从 iOS 生成的令牌并在任何我喜欢的地方使用它。当然,这可以通过使用 App Secret 来缓解,这样调用只能从 Facebook 服务器进行。然而,由于它是 Facebook,因此已经进行了其他内部检查以发现任何可疑的 activity.

after the user uninstalls the iOS app, reinstalls it and tries to connect with Facebook, a function should be usable to gather the Facebook User Access Token, as it should logically be linked to a user, not to a device

正确。令牌链接到用户和客户端(通过 machine_id)。 https://developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension

If right, how can a Facebook User Access Token be regathered when the user (re)installs the app?

令牌是从会话中生成的。他们没有重新聚集。每次用户打开 Facebook 应用程序并必须登录时,都会生成一个新令牌。不必太深入,只要设备中的用户存在有效会话,就会生成新令牌。即使没有会话,用户也可以使用 user/password 登录,这将生成访问令牌和会话。