Deployment on a hero without redirecting to localhost with passport callback

I deployed the application for Heroku , however, as soon as you click "login with facebook", you are redirected to http: // localhost: 3000 / # = . I tried the following (the first one where it is now):

passport.use(new FacebookStrategy({ clientID: FACEBOOK_APP_ID, clientSecret: FACEBOOK_APP_SECRET, callbackURL: "http://localhost:3000/auth/facebook/callback" }, function(accessToken, refreshToken, profile, done) { process.nextTick(function () { return done(null, profile); }); } )); 

but when deployed with:

 passport.use(new FacebookStrategy({ clientID: FACEBOOK_APP_ID, clientSecret: FACEBOOK_APP_SECRET, callbackURL: "/auth/facebook/callback" }, 

or

 passport.use(new FacebookStrategy({ clientID: FACEBOOK_APP_ID, clientSecret: FACEBOOK_APP_SECRET, callbackURL: "https://fivemincatchup.herokuapp.com/auth/facebook/callback" }, 

it sends the following error to facebook:

This URL is not allowed by the application configuration: one or application parameter settings are not allowed. This should match the website URL or canvas URL, or the domain should be a subdomain of one of the application domains.

Am I missing something really obvious ?!

+5
source share
1 answer

Have you added a callback url to your app settings? You must add the website URL, as in the settings for the facebook developer application, so that it allows facebook to make callbacks to any particular website.

There should be either basic site URL settings or advanced settings in "Valid OAuth redirect URIs"

(see also here )

+5
source

All Articles