Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FacebookTokenError #267

Open
guitar9 opened this issue Dec 30, 2019 · 2 comments
Open

FacebookTokenError #267

guitar9 opened this issue Dec 30, 2019 · 2 comments

Comments

@guitar9
Copy link

guitar9 commented Dec 30, 2019

I tried everything but I get everytime this error: (translated with google translate)

FacebookTokenError: URL cannot be loaded: The domain of this URL does not exist in the domains of the app. To be able to load this URL, add all domains and subdomains to your app in the appdomain field in your app settings.
    at Strategy.parseErrorResponse (/usr/src/app/node_modules/passport-facebook/lib/strategy.js:198:12)
    at Strategy.OAuth2Strategy._createOAuthError (/usr/src/app/node_modules/passport-oauth2/lib/strategy.js:405:16)
    at /usr/src/app/node_modules/passport-oauth2/lib/strategy.js:175:45
    at /usr/src/app/node_modules/oauth/lib/oauth2.js:191:18
    at passBackControl (/usr/src/app/node_modules/oauth/lib/oauth2.js:132:9)
    at IncomingMessage. <anonymous> (/usr/src/app/node_modules/oauth/lib/oauth2.js:157:7)
    at emitNone (events.js: 111: 20)
    at IncomingMessage.emit (events.js: 208: 7)
    at endReadableNT (_stream_readable.js: 1064: 12)
    at _combinedTickCallback (internal / process / next_tick.js: 139: 11)
    at process._tickCallback (internal / process / next_tick.js: 181: 9)

This is my code:

passport.use(new FacebookStrategy({
    clientID: "XXX",
    clientSecret: "XXX",
    callbackURL: '/return'
  },
  function(accessToken, refreshToken, profile, cb) {
    return cb(null, profile);
  }));

router.get('/login/facebook',
  passport.authenticate('facebook'));

router.get('/return', 
  passport.authenticate('facebook', { failureRedirect: '/login' }),
  function(req, res) {
    console.log("Test")
    res.redirect('/');
  });

This are my settings:

Bildschirmfoto_2019-12-30_12-32-43
Bildschirmfoto_2019-12-30_12-32-56
Bildschirmfoto_2019-12-30_12-33-13

I dont know what to do. Somebody can help me?
You can test it at localmelodies.com and then click on register and type a username and a city and then there is the facebook login button.

Environment

  • Operating System: linux
  • Node version: 8.10.0
  • passport version: 0.4.1
  • passport-facebook version:3.10.10
@guitar9 guitar9 changed the title FacebookTokenError FacebookTokenError 10€ Dec 30, 2019
@guitar9 guitar9 changed the title FacebookTokenError 10€ FacebookTokenError Dec 30, 2019
@sanglnv
Copy link

sanglnv commented Jan 15, 2020

I has faced this issue for days, anyone can help?

@sanglnv
Copy link

sanglnv commented Jan 15, 2020

Hi, for FacebookStrategy, the callbackURL must conclude with the full path of your /return route
for example https://www.example.com/return instead of just /return
Hope this help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants