Facebook API:如何验证网络应用程序

发布于 2024-12-12 07:33:21 字数 268 浏览 3 评论 0原文

我正在尝试为 web 应用程序编写一个插件,使用 Javascript API 将其与 facebook 集成。该应用程序由我们的客户安装在他们自己的服务器上,每个服务器都有自己的站点名称。这给我带来了一个问题,因为 Facebook 希望我为应用程序指定一个站点 URL。这个 URL 对于每个客户来说都是不同的。为每个客户创建一个新的应用程序并不是一种选择。

在我对这个问题的研究中,我似乎必须假装是一个桌面应用程序并遵循该身份验证路径。我不知道该怎么做。

任何人都知道如何做到这一点?

I am attempting to write a plugin for a webapp that integrates it with facebook using the Javascript API. The application is installed by our customers on their own servers each with their own site names. This poses a problem to me as Facebook wants me to specify a site url for the application. This url is going to be different for every customer. Creating a new application for each customer is not an option.

In my research of this problem it seems that I have to pretend to be a desktop app and follow that authentication path. I cannot figure out how to do this.

Anyone have any idea how this can be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

放血 2024-12-19 07:33:21

您打算将该应用程序作为画布应用程序还是在 Facebook 之外托管?

网址对您重要吗? base-url 和 application 之间存在严格的一对一关系。

许多应用程序所做的是将应用程序作为目录托管在其域中。例如 http://crazy-fb-app.com/customername

这基本上就是你的选择,如果你想要使用Javascript SDK。

如果您要使用服务器端技术,您可以让用户授权应用程序,同时请求在用户离线时访问用户数据的权限。在这种情况下,您将收到一个未过期(或长期过期)的身份验证令牌,您可以使用该令牌从服务器代表用户进行 Graph API 调用。对于某些内容,您可以获取应用程序身份验证令牌(较短且非特定于用户)来调用图表。

罗特姆

Are you going to host the app as a canvas app or outside facebook?

Is the url important to you? There is a strict one-to-one relation between base-url and application.

What many apps do is host the apps as directories in their domain. For example http://crazy-fb-app.com/customername

That's your options basically if you want to use Javascript SDK.

If you're going to be using server side technology you could have the user authorize the application while requesting permission to access user's data while he's offline. in that case you will receive a non-expiring (or long-expiring) authentication token which you can use from the server to make Graph API calls on behalf of the user. For some stuff you can obtain an Application Auth token (which is shorter and non-user-specific) to make calls to the graph.

Rotem

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文