问题
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