无需身份验证即可解码签名请求
我们是否能够使用 Facebook C# SDK 来解码传递到 Facebook 选项卡页面的 signed_request 参数,不使用身份验证?基本上,我正在寻找一种方法来解码和解析signed_request 包含的页面 JSON 对象。
我正在寻找相当于在这个 PHP 示例中完成相同类型解码的 .NET C# : 无缝地检查用户是否喜欢页面
Are we able to use the Facebook C# SDK to decode the signed_request parameter that is passed to the Facebook Tab page, without using Authentication? Basically, I am looking for a way to decode and parse the page JSON object that the signed_request contains.
I am looking for the .NET C# equivelent to accomplishing the same type of decode in this PHP example: Seamless way to check if user likes page
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是粘贴我在另一篇文章中回答过的相同答案。
带有 asp.net 的 facebook 中仅限粉丝观看的内容C# sdk
当您的网页在 facebook canvas 应用程序中加载时,您会收到签名请求;您应该能够解析类似于以下内容的签名请求:
您需要添加对 json 库的引用才能解析 C# 中的签名请求,请从 http://json.codeplex.com/
另请参阅如何在 C# 中解码 Canvassigned_request 的 OAuth 2.0 ? 如果您对签名请求感到厌倦。
I am just pasting same answer I have answered in another post.
Fans-only content in facebook with asp.net C# sdk
You get signed request when your web page is loaded within facebook canvas app; you should be able to parse signed request something similar to following:
You need to add reference to json libraries in order to parse signed requestin C#, download from http://json.codeplex.com/
Also refere to How to decode OAuth 2.0 for Canvas signed_request in C#? if you are worndering about signed request.
“未经身份验证”是什么意思?签名的请求是使用您的应用密钥进行签名的,因此无论当前用户是否授权您的应用,您都可以对其进行解码
{edit}我现在意识到您引用的是一个名为 Authentication 的库{/edit}
如果您找到其他库或重新实现 HMAC SHA-256 和 base64url 解码器的算法我确信您可以在不使用特定库的情况下做到这一点,但使用它可能更容易
What do you mean 'without authentication'? The signed request is signed with your app secret, so you can decode it regardless of whether the current user has authorised your app
{edit} I now realise you're referring to a library named Authentication{/edit}
If you find another library or reimplement the algorithm for HMAC SHA-256 and a base64url decoder i'm sure you could do it without using that specific library, but it's probably easier to just use it