facebook-oauth

How do you get long-lived access tokens from the Facebook Graph API (server-side auth)?

北战南征 提交于 2019-12-03 08:53:00
Since Facebook is removing the offline_access permission, I want to go ahead an migrate our website to use the new system. I found this document on Facebook's website: https://developers.facebook.com/roadmap/offline-access-removal However, when I process someone with Server-Side authentication, I get this response: access_token => BLAHBLAHBLAHdontusemytokensilly expires => 4992 When I try and use the acces point (on that document) to extend the access token more than a couple hours, I get this back: access_token => BLAHBLAHBLAHdontusemytokensilly expires => 4990 According to that document,

Passport-Facebook not providing email even if it is in scope

五迷三道 提交于 2019-12-03 08:40:54
问题 In my application i register the facebook-strategie as follows: But the returned profile does not contain the email-field.... passport.use(new FacebookStrategy({ clientID: config.facebook.clientID, clientSecret: config.facebook.clientSecret, callbackURL: config.facebook.callbackURL, passReqToCallback: true }, function(req, accessToken, refreshToken, profile, done) { // No email in the following colsole.log console.log(JSON.stringify(profile)); })); The get is as follows: app.get('/oauth

Getting “Error validating access token” from Facebook for some users

自作多情 提交于 2019-12-03 07:08:16
问题 I'm getting the following error from Facebook when trying to post to a users stream. Error validating access token: The session has been invalidated because the user has changed the password or because auth.expireSession was called. The workflow is as follows: Authorize with Facebook requesting scope=offline_access,publish_stream permissions (if the current user has not already authorized) Do some work on the server (takes 5-10 minutes) Attempt to publish to the user's Facebook stream This

infinite loop going back to authentication page when using OAuth in MVC5

谁说胖子不能爱 提交于 2019-12-03 06:49:45
I have written a webpage that takes advantage of Google/Facebook auth using MVC5 and OAuth sometimes, I'm able to auth very well using either Facebook or Google. It works quite well. However often what happens is Navigate to the login page Choose either google or facebook provide the account info, getting the necessary redirects redirect back to login page, but not logged in I'm not receiving (or not looking in the right place) any errors that clue me in - I am using SSL on Azure for hosting Does anyone have tips for why it sometimes works, and sometimes does not? this feels like it could be a

Is there any way to fetch all Facebook events in a specific city?

六眼飞鱼酱① 提交于 2019-12-03 05:48:28
问题 Can I fetch all Facebook events in a specific city? All I need is event IDs nothing else. It should be all events (public), not only someone's events. Will Facebook let us fetch that info? 回答1: Elmcity does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events in the UK, PA, NY OH and CA. You can also search for a non-location based word in the title like "picnic" and the script returns events. You can try to query for events by location. With the

window.open without popup blocker using AJAX and manipulating the window.location

梦想与她 提交于 2019-12-03 03:56:47
问题 When dealing with OAuth from the server, such as Twitter and Facebook, you most likely will redirect the user to an URL asking for app permission. Usually, after clicking a link, you send the request to the server, via AJAX, and then return the authorization URL. But when you try to use window.open when the answer is received, your browser blocks the popup, making it useless. Of course, you can just redirect the user to the new URL, but that corrupts the user experience, plus it's annoying.

Weird url appended “#_=_” [duplicate]

。_饼干妹妹 提交于 2019-12-03 01:03:10
This question already has answers here : Play Framework appending #_=_ to redirect after Facebook auth via OAuth2? (2 answers) Possible Duplicate: Play Framework appending # = to redirect after Facebook auth via OAuth2? Has anyone else seen this happen? I am building a Facebook canvas app using the Facebook PHP SDK, and some Javascript. Now when I take the user through the OAuth authentication flow, I have noticed that the URL in the browser automatically gets appended with this "#_=_" , so my URL starts looking like this: http://apps.facebook.com/xxxxxxxxxxxx/#_=_ and when I redirect to the

Passport-Facebook not providing email even if it is in scope

风格不统一 提交于 2019-12-03 00:12:06
In my application i register the facebook-strategie as follows: But the returned profile does not contain the email-field.... passport.use(new FacebookStrategy({ clientID: config.facebook.clientID, clientSecret: config.facebook.clientSecret, callbackURL: config.facebook.callbackURL, passReqToCallback: true }, function(req, accessToken, refreshToken, profile, done) { // No email in the following colsole.log console.log(JSON.stringify(profile)); })); The get is as follows: app.get('/oauth/facebook', passport.authenticate('facebook', { failureRedirect: '/login', scope:['email'] })); (So i am

Universal Analytics and signup with Facebook

感情迁移 提交于 2019-12-02 22:59:05
I have a website (theneeds.com) that allows signup via Facebook. We're running several campaigns, e.g. on Facebook itself, and we'd like to properly track signups from the different campaigns. The problem is with Universal Analytics: when a user signs up with Facebook, she triggers a new session thus loosing the campaign reference. Two possible solutions are: remove the analytics tracking on the signup form (i.e. the page that causes the new session to start) add facebook.com to the referral exclusion list Unfortuantely both have disadvantages, so I'm wondering if there is any best practice or

Getting “Error validating access token” from Facebook for some users

僤鯓⒐⒋嵵緔 提交于 2019-12-02 19:41:33
I'm getting the following error from Facebook when trying to post to a users stream. Error validating access token: The session has been invalidated because the user has changed the password or because auth.expireSession was called. The workflow is as follows: Authorize with Facebook requesting scope=offline_access,publish_stream permissions (if the current user has not already authorized) Do some work on the server (takes 5-10 minutes) Attempt to publish to the user's Facebook stream This code works for many users, but for some users, I get the Error validating access token error. It started