会话已经失效,因为用户更改密码 [英] The session has been invalidated because the user has changed the password

查看:188
本文介绍了会话已经失效,因为用户更改密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实现一个PhoneGap的应用程序为Android和iOS的应用程序正在使用Facebook Connect和PhoneGap的Facebook连接插件(https://github.com/davejohnson/phonegap-plugin-facebook-connect)。前几天,我开始与access_token有问题,但只能在Android上,同样的情形适用于iOS的没有问题。一步一步是:

Implementing a PhoneGap app for Android and iOS, the app is using Facebook Connect and the PhoneGap Facebook Connect Plugin (https://github.com/davejohnson/phonegap-plugin-facebook-connect). A few days ago I started having problem with the access_token, but only on Android, the same scenario works on iOS without problems. The step by step is:

  1. 在初始化的Facebook。 (使用插件功能)
  2. 登录到Facebook。 (使用插件功能)(要求的权限:电子邮件user_birthday publish_stream offline_access')
  3. 请图形API调用/使用我的令牌退还给我。

步骤3将返回错误,当我把所谓的,放在桌面浏览器的URL,它给我的错误。

Step 3 returns error, and when I take the url called and put in a desktop browser, it gives me the error "The session has been invalidated because the user has changed the password".

沙盒应用程序/非沙盒应用程序没有任何区别。

Sandbox app/ non-sandbox app does not make any difference.

在iOS的确切相同的步骤工作正常。

The exact same steps in iOS works fine.

我看到了很多关于SOF和Facebook关于它的问题,但所有的人都指的是让用户做身份验证流程一遍,还是这个问题,几天后解决自身....有没有别人,可以证实,这的确是一个Facebook的错误?还是有办法解决吗?或者可以解释为什么它适用于Android和iOS的不是?也许这可能与我在iOS中不使用Facebook的应用程序,但选择总是通过在浏览器中的OAuth去了?

I saw a lot of questions on SOF and facebook about it, but all of them are referring to letting the user do the auth flow again, or that the problem solved itself after a few days.... Is there someone that can confirm that this is really a facebook bug? Or have a solution? Or can explain why it works on Android and not iOS? Maybe it could have to do with me in iOS not using the facebook app, but choosing to always go via the OAuth in browser?

感谢您的任何蛛丝马迹!

Thanks for any clues!

编辑:

找到其他相关的问题,似乎有相同的根本原因是我的。

Found to other related questions, that seems to have the same root cause as mine.

<一个href="http://stackoverflow.com/questions/7883524/how-can-i-remove-all-potentially-cached-tokens-or-session-ids-on-android">How我可以删除所有可能缓存令牌或会话ID在Android?

访问令牌立即失效

推荐答案

好了,到最后我发现我的问题的根本原因是,Android和iOS的Facebook SDK的被处理offline_access不同,在价值,他们在会话对象中的到期参数设置。

Ok, in the end I found out that the root cause of my problem was that Android and iOS facebook SDK's are handling the offline_access differently, in the value that they set in the 'expires' parameter in the session object.

在iOS系统中,'过期'将被设置为一个日期远在遥远的将来(4001-01-01),而在Android的到期'将被设置为0。这使我的比较(过期&LT;今天)失败(我在做一个日期解析到毫秒级),会话总是无效。

In iOS, 'expires' will be set to a date far far in the future (4001-01-01), while in Android 'expires' will be set to 0. This made my comparison (expired < today) fail (I was doing a date parse to milliseconds), and the session was always 'invalid'.

(当时我的情况下,我总是在做注销如果会议是无效的,这让我的令牌之后在浏览器中尝试它的时候是真的无效..卫生署..)

(then in my case i was always doing a logout if the session was invalid, which made my token be invalid for real when trying it in the browser afterwards.. doh..)

这篇关于会话已经失效,因为用户更改密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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