与Facebook网络应用集成(结构问题) [英] Web app integration with facebook ( architecture issues )

查看:152
本文介绍了与Facebook网络应用集成(结构问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立我自己的社交平台Facebook上的顶部,并在我的web应用程序的体系结构些建议将受到欢迎。

I'm building my own social platform on top of facebook, and some advice on the architecture of my web app would be welcome.

我需要从Facebook的API的返回,为了得到这些数据,我知道我需要让我的用户与Facebook(OAuth 2.0用户)登录的一些数据。在此之后是哪里,我有点糊涂了。

I need some data that is returned from the Facebook APIs, in order to get that data I know I need to make my users login with Facebook ( OAuth 2.0 ). After this is where I'm a little bit confused.

我应该叫Facebook的API的从后端(我使用Python),然后返回相同的数据传回作为回应?

Should I call Facebook APIs from the backend ( I'm using Python ) and then return that same data back as a response?

我应该叫从前端(浏览器的JavaScript)Facebook的API,然后重新发送数据到我的后台?

Should I call Facebooks API from the front end ( browser's Javascript ) and then sent that data again to my backend?

一旦用户已授权我的应用程序,可以在后台继续从Facebook的API获取信息?

Once the user has authorized my app, can the backend keep getting info from facebook APIs?.

先谢谢了。

推荐答案

一旦你获得了Facebook的访问令牌是真的取决于你如何使用它。这是完全正常的,如果你只从浏览器访问Facebook的API,并且如果你从服务器上做。这一切都取决于你想要达到什么目的。

Once you get the Facebook Access Token is really up to you how you use it. It is perfectly fine if you only access the Facebook API from the browser and also if you do it from the server. It all depends on what you want to achieve.

如果您想后端能够访问Facebook的API,它需要有访问令牌。此外,令牌都有一个有效期,因此只要它是有效的,后端可以保持从Facebook请求数据,但一旦过期,你必须更新它。

If you want the backend to have access to the Facebook API it needs to have the access token. Also, the token has an expiration date, so as long as it is valid, the backend can keep requesting data from Facebook, but once it expires you'll have to renew it.

这篇关于与Facebook网络应用集成(结构问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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