2015-05-25 19 views
5

Ho distribuito un'app a Heroku, tuttavia, una volta fatto clic su "accedi con Facebook", si viene reindirizzati a http://localhost:3000/#=. Ho provato la seguente (il primo è dove si trova al momento):Distribuire su heroku senza reindirizzamento a localhost con callback passaporto

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); 
    }); 
    } 
)); 

ma quando schiero utilizzando:

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

o

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

si dirige a facebook con il seguente errore:

Given URL is not permitted by the Application configuration: One or more of the given URLs is not permitted by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains.

Am I manca qualcosa di veramente ovvio ?!

risposta

5

È stato aggiunto l'URL di richiamata alle impostazioni dell'app? Devi aggiungere l'URL del sito come quello nelle impostazioni dell'app dello sviluppatore di Facebook per consentire a Facebook di effettuare callback su qualsiasi sito web specifico.

dovrebbe essere sotto sia le impostazioni di base sul URL del sito o le impostazioni avanzate su "OAuth valido reindirizzare URI"

(vedi anche here)