Web app integration with facebook ( architecture issues )

空扰寡人 提交于 2019-12-13 20:12:42

问题


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

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.

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

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

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

Thanks in advance.


回答1:


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.

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.



来源:https://stackoverflow.com/questions/10989940/web-app-integration-with-facebook-architecture-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!