Facebook 解码的signed_request 包含文档中未提及的额外数据
我有一个 Facebook signed_request
,通过订阅 auth.login
事件以及用户使用 facebook 登录按钮
在解码 signed_request
后,其中包含以下信息:
{'issued_at': 1318492701,
'code': 'AQCXI5aiyYtYLFNtkYhtKwDhO02lP[truncated]',
'user_id': '100000xxxxxxxxx',
'algorithm': 'HMAC-SHA256'}
我无法在<一href="http://developers.facebook.com/docs/authentication/signed_request/" rel="noreferrer">signed_request 文档。这个代码
是什么以及它的用途是什么?
我认为它可能用于获取授权代码,如此线程 但除了 signed_request
之外,我还在登录事件的响应中收到了用户的访问令牌。
I have a Facebook signed_request
which is received by subscribing to the auth.login
event and after the user logs in using the facebook login button
After I decode the signed_request
I have the following information in it:
{'issued_at': 1318492701,
'code': 'AQCXI5aiyYtYLFNtkYhtKwDhO02lP[truncated]',
'user_id': '100000xxxxxxxxx',
'algorithm': 'HMAC-SHA256'}
I cannot find in the signed_request documentation. What is this code
and what's its use?
I thought it might be used to obtain an authorization code as stated in this thread but along with the signed_request
I also receive an access token for the user in the response from the login event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不知道为什么他们没有提到使用文档页面上的代码来签名请求。该代码可以交换为访问令牌,这是发出任何后续 Facebook API 请求的关键。
相关文档位于:https://developers.facebook.com/docs/authentication/
I don't know why they don't mention use of the code on the documentation page for signed requests. The code can be exchanged for an access token that is the key to making any subsequent Facebook API requests.
Relevant documentation is here: https://developers.facebook.com/docs/authentication/
这是来自 JavaScript SDK 的signed_request,对吧?该代码由 SDK 使用,但不用于服务器端身份验证。实际上,我们将更新文档以反映signed_request 行为。
This is the signed_request from the JavaScript SDK, right? The code is used by the SDK but isn't for the Server-side Authentication. Actually, we will update the documentation to reflect the signed_request behaviors.
该代码对于获取有关安装您的应用程序的用户的信息很有用
,但无论如何请告诉我您需要哪些信息,然后我可以
很好地为您提供示例代码,如果您再次检查您发布的代码,您会看到您有用户 ID
因此您不需要为此使用访问令牌,
但无论如何都可以获取基本信息和信息任何其他信息或发布&删除有两种方法:
第一种:直接删除(不需要sdk,但是更难)
第二:通过sdk(很简单)
我推荐你使用 sdk &如果您的服务器端编程语言是 PHP,您可以执行此操作来获取
下载的 基本信息
下载 php sdk
https://developers.facebook.com/docs/reference/php/
that code is useful to get information about users who installed your app
but anyway tell me which information is needed for you then i can give you sample code
well, if you check your posted code again you see you have user id
so you do not need to use access token for this
but anyway for getting basic information & any other information or posting & deleting you have two ways :
first:do it directly (no need to sdk,but harder)
second: via sdk (its easy)
i recommend to you to use sdk & if your server side programming language is PHP you can do this for getting basic information
for downloading
download php sdk
https://developers.facebook.com/docs/reference/php/
您必须访问此 Facebook 官方文档 并阅读“signed_request 参数”及其下面的文本解码
signed_request
后得到的代码You have to visit this facebook offical doc and read "signed_request Parameter" and its below text for the code which you get after decoding
signed_request