passport-facebook node app doesn't seen to work - node.js

https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=https%3A%2F%2Fpanorart-victor3991.c9users.io%2Fauth%2Ffacebook%2Fcallback&scope=emails&client_id=547453695448009
My app is still under development.
It used to work with facebook login. But it suddenly got to the 500 error with the text:
Sorry, something went wrong.
We're working on getting this fixed as soon as we can.
I thought this might be the facebook internal network error but the issue had been on for almost a month.
Does anyone have some idea why it's happening?
I'm also using google oauth with similar logic and it's working fine.

For me it was the scope passed via passport that was incorrect. I used the google scope which was profile and email, whereas facebook required publish_actions. Hope this helps

Related

Facebook Auth Error

it will be great if someone can help me with this and I have researched for countless hours on stack overflow already
This is my login page​​
When I click on the facebook button, it takes me to /auth/facebook​
Then after that, I get redirected to a
ECONNRESET: Request could not be proxied!
There was an error proxying the request error.
In the terminal, it says:
enter image description here
​
How do I fix this? PS.
Going off this tutorial
https://scotch.io/tutorials/easy-node-authentication-facebook​
Also Im using node.js, MongoDB, express.js, and facebook
Much thanks and have an amazing day
From the error that I'm seeing when trying to authenticate your app via Facebook, it seems as if your domain URL has not been properly added to Facebook's Developer API.
Are the proper URL's entered for your Facebook App Domains (in Basic Settings) and Valid OAuth redirect URIs (in Facebook Login Settings)?
Also, regarding that Node error that you're receiving, what is on line 60 of your Passport.js file?

The `ApplicationCredential` instance is not valid. Details: `provider` can't be blank

I am trying to get Facebook login working with loopback using their loopback-component-passport plugin.
I have configured app details in providers.json and now if I visit http://localhost:3000/auth/facebook I am redirected to facebook and can successfully login. However, when I get redirected back (to /auth/facebook/callback) I get the following error --
ValidationError
422 The 'ApplicationCredential' instance is not valid. Details:providercan't be blank (value: undefined).
I can't make sense of this error because the providers file is where the fb app and paths etc are configured and they are definitely working.
The plugin is poorly documented so I am out of ideas at this point.
I have figured out the cause for this error. I had initiated my loopback project as a blank project. However for loopback-component-passport to work it requires User, AccessToken, ACL models to be available. These are inbuilt in loopback and can be manually added to model-config.json. Or, you can initialize the project with user authentication and it should work.
This was one of many roadblocks that I ran into due to my lack of knowledge in the area and Loopback's poor documentation for the plugin. The Tutorial section in the docs and the example github project it links to are completely out of date.

TokenError: Code was already redeemed - Passport Google OAuth

I am trying to auth my app with passportjs using email strategy.
However I always get code redeemed error. I found out that callback is being called 2 times (we see it on wireshark logs).
I opened a ticket on GitHub
https://github.com/jaredhanson/passport-google-oauth/issues/105
Looks like it works fine for most people, but not for me.
So I'm looking for people who have experience of fixing it.
There is no need to paste source here as long as it's exactly the same code provided in examples for passportjs
I managed to get it working by using external ip address and specifying it for google callback url.

Spotify Web API won't work for a specific user?

I'm trying to use the web api to query a user's playlists (using the spotipy Python library). I got the user to oAuth in, got an access token, made the request and got a 500 error:
SpotifyException: http status: 500, code:-1 - https://api.spotify.com/v1/users/125139403/playlists?limit=50&offset=0: Server error.
I then tried the same request in Web API test console and it worked fine.
But then things get kind of weird. I tried running the cURL command the console generated in a terminal and got the same 500 error.
Then I tried running the same request using cURL but just changing the username in the URL and it worked fine (at least for public playlists) for both my username and a random friend's user ID number.
I thought maybe I'm having a token issue but the token I'm using seems to work fine with other usernames. It's just the one specific user for whom I'm getting the error.
I'd rather not post the user's ID on this public forum but I can email it to someone if it's relevant.
My best guess for what's wrong at this point is a bug on Spotify's side but I certainly could be doing something wrong.
Again, thanks for reporting this. This bug was fixed by Matt M. and was just deployed to production.
Please try it out in our API Console. (which Matt was also part of building!)

Foursquare OAuth suddenly not working

I have a Foursquare app that I'm trying to get integrated into a website I'm working on, it has been working fine up to this point but suddenly trying to go the URL "https://foursquare.com/oauth2/authenticate?client_id=[MY_APP_ID]&response_type=code&redirect_uri=[REDIRECT_URL]" is giving me an "invalid_token" error, which is strange to me because I haven't even gotten to the second part of the OAuth "dance". Am I missing something obvious? Thanks!
We're able to reproduce and are investigating. Thanks for the report!
There is something wrong with https://foursquare.com/oauth2/authenticate endpoint. Try https://foursquare.com/oauth2/authorize instead.
We just tweeted to #FoursquareAPI and #4sqSupport. Its broken for us as well as IFTTT

Resources