如何删除 Android 上所有可能缓存的令牌或会话 ID?
一个奇怪的问题,但希望有人能回答。
我正在开发一个与 Facebook 连接的移动应用程序。一切都很顺利,已经持续了大约一周。我可以授权和删除授权并发布到用户的提要。
周六或周日我修改了我的请求以添加离线访问。大约在那个时候(不幸的是,我无法确定确切的时间),我开始收到返回的失败消息,称访问令牌无效(“验证访问令牌时出错:会话已失效,因为用户更改了密码。”)。
我知道这是错误的,因为我没有更改密码,我刚刚收到访问令牌并且响应都很好。事实上,我在获得授权后立即发布到提要(“嘿,我正在使用 TheApp”),并且该发布因上述错误而失败。
这里是问题升级的地方:我进入移动 Facebook 应用程序来验证访问和连接。突然,官方 FB 应用程序开始给我带来同样的问题。它开始弹出登录对话框。我输入密码,它显示一个提示,表示登录成功,然后在几秒钟后再次要求登录。经过一两次尝试后,它最终会显示另一个 toast,其中包含上面的无效令牌消息。
我清除我的应用程序,卸载它,注销并清除所有 FB 数据(使用设备设置中的管理应用程序),然后强制停止该应用程序。我无法卸载 FB,所以这是我能做的最多的事情。我也去 FB 网站更改我的 FB 密码。我返回 FB 应用程序,再次登录,在 feed 活动完成加载之前,它再次提示我输入密码,我们又回到了旧的循环。我尝试了我的应用程序,它位于同一个存储桶中(这并不奇怪)。
另外两个数据点:
- 我有时可以使用 Graph API Exlorer Web 应用程序来实现相同的行为。我可以使用 Graph API Explorer 本身的令牌一致地执行此操作,并且可以与我的应用程序中的访问令牌不一致地获取它。
- 我启动了一个模拟器(没有 FB 应用程序)并在那里运行我的应用程序。以我的身份登录,我可以获得访问令牌,一切正常。我的应用程序毫无怨言地发布到我的提要。
此时,FB(显然还有任何 FB 连接应用程序)已连接到我的真实设备上。它要么只是设备,要么是设备加上我的帐户的组合(我没有任何其他 FB 帐户可以尝试)。
谁能告诉我我需要做什么来进一步调试或清除它?
An odd question, but hopefully someone has an answer.
I am developing a mobile app that will connect with Facebook. Everything was working fine and had been for about a week. I could authorize and remove authorization and post to a user's feed.
On Saturday or Sunday I modified my request to add offline_access. Around that time (unfortunately I cannot be sure exactly when) I started receiving failures coming back saying the access token was invalid ("Error validating access token: The session has been invalidated because the user has changed the password.").
I know this to be false because I haven't changed my password and I just received the access token and the responses were all fine. In fact, I post to the feed immediately after getting authorized ("Hey, I'm using TheApp") and that post fails with the above error.
Here's where it escalates: I went to the mobile Facebook app to verify access and connectivity. Suddenly the official FB app starts giving me the same problems. It starts popping up login dialogs. I enter my password, it shows a toast saying login succeeded and then asks for the login again a few seconds later. After a try or two of this it ends up displaying another toast with the invalid token message from above.
I clear my app, uninstall it, logout and clear all FB data (using Manage Apps in the device settings), and force stop the app. I can't uninstall FB so that's the most I can do. I also go to the FB site and change my FB password. I go back to the FB app, login again, and before the feed activity even finishes loading it's prompting me for my password again and we're back into that old cycle. I try my app and it's in the same bucket (no surprise there).
Two more data points:
- I can sometimes get this same behaviour to occur using the Graph API Exlorer web app. I can do it consistently with a token for the Graph API Explorer itself and I can get it inconsistently with an access token from my app.
- I fired up an emulator (one without the FB app) and ran my app there. Logging in as me I can get an access token and everything works. My app posts to my feed with no complaints.
At this point, FB (and apparently any FB-connecting app) is hosed on my real device. It is either just the device or a combination of the device plus my account (I haven't any other FB account to try).
Can anyone shed some light on what I need to do to either debug this further or clear it up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论