Facebook在页面选项卡上获取用户标识(signed_request) [英] Facebook get user id on page tab (signed_request)

查看:187
本文介绍了Facebook在页面选项卡上获取用户标识(signed_request)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到问题。

我有自定义页面标签,当前用户查看它。
我要求用户将扩展权限授予他的个人资料(使用Facebook.showPermissionDialog)。
如果他授予权限,理论上我可以访问Graph API和其他内容。
但是当我从Facebook解析新的signed_request参数时,我得到oauth_token,绑定到当前页面选项卡,而不是用户配置文件。换句话说,请求Graph API方法我给我我的自定义页面配置文件。我想得到用户的个人资料!我应该如何访问它?

I have custom page tab, and current user viewing on it. I ask user to grant extended permissions to his profile (using Facebook.showPermissionDialog). If he grants permissions, theoretically, i would have access to the Graph API and other stuff. But when i parse new signed_request param from Facebook, i get oauth_token, bound to current page tab, not to user profile. In other words request to Graph API method 'me' gives me my custom page profile. And I want to get user's profile! How should i get access to it?

如何在Facebook选项卡上访问用户的Graph API?

How to get access to user's Graph API on Facebook tab?

推荐答案

我已经弄清楚它是如何工作的。在用户授予权限后,当通过Ajax在我的服务器上调用页面时,Facebook发送当前用户的signed_request(以及他的ID)。当页面静态加载时,您将获得signed_request的页面选项卡。希望会帮助某人。

I've figured out how it works. After the user grants permissions, Facebook sends signed_request of current user (and his ID as well), when calling page on my server via Ajax. When the page loads statically - you get signed_request of page tab. Hope it will help somebody.

这篇关于Facebook在页面选项卡上获取用户标识(signed_request)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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