授权为桌面应用程序时如何设置 Facebook Chat API 连接
我面临的问题是,在我为当前用户授权我的应用程序后,使用 http://developers.facebook.com/docs/authentication/(客户端流程) 我无法设置 XMPP 连接,因为我需要知道会话密钥才能访问它。使用基于服务器的流时,会话属性将作为访问令牌的一部分发送。我没有找到一种方法来获取基于 oAuth 的身份验证客户端流程的会话密钥。 请建议我怎样才能得到它。
我正在执行来自 javascript(Google Chrome 扩展)的所有请求。
The problem I am facing is that after I authorize my app for current user using
http://developers.facebook.com/docs/authentication/ (client-side flow)
I can't setup a XMPP connection as I need to know session key to access it. When using server-based flow, the session properties are being sent as a part of access token. And I didn't find a way to get the session key for my oAuth based authentication client-side flow.
Please suggest how can I get it.
I'm doing all requests from javascript (Google Chrome extension).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Facebook 实际上正在弃用会话密钥。他们最近(我相信您发布问题几天后)更新了他们的身份验证方法,不再需要会话密钥。如果出于某种原因您仍然需要它,您可以通过在 REST API 中查找 auth.promote_session 方法来获取它,但该方法已被弃用,并将在 10 月份被删除。
如果您检查 https://developers.facebook.com/docs/chat/ 您应该会发现访问令牌将为您提供您现在需要的东西。
Facebook is actually deprecating the session key. They have just recently (a couple days after you posted the question i believe) updated their authentication method to no longer require the session key. If for whatever reason you still need it you can get it by looking up the auth.promote_session method in the REST API, but that is deprecated and will be removed come October.
If you check https://developers.facebook.com/docs/chat/ you should find that the access token will get you what you need now.