Node.js Passport get Facebook session on Page Load

不问归期 提交于 2019-12-24 01:29:49

问题


I've got the passport Facebook Strategy working fine. However, reading facebook documentation I stumble upon this :

FACEBOOK DOCS

A special consideration when using the Query String setting:

If you would like to use the server-side authentication flow with App Center it is important to make sure you are passing the redirect_uri parameter correctly when exchanging your code for an access token. You should set your redirect_uri parameter to the click-through URL to your site. In most cases the URL will look something like:

http://www.example.com/?fb_appcenter=1&fb_source=search&code=CODE_HERE thus you should set your redirect_uri to the same value. Please make sure that this logic is dynamic as the query parameters appended to your click-through URL may be subject to change.

On the App Center there is a visit website button that sends users to the app and in the process logs them in. How can I do this with passport? Do I have to add the query string to the callbackURL? I'm guessing it's the same problem, but I'd also need something like the FB.getLoginStatus() provided by facebook javascript SDK to link users if they have their facebook open and previously added the app. Is all this provided by passport in any way?

来源:https://stackoverflow.com/questions/13149896/node-js-passport-get-facebook-session-on-page-load

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