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

OAuth2 Strategy issue #2456

Closed
amirmog opened this issue Jan 11, 2017 · 1 comment
Closed

OAuth2 Strategy issue #2456

amirmog opened this issue Jan 11, 2017 · 1 comment

Comments

@amirmog
Copy link

amirmog commented Jan 11, 2017

Hello folks,

Could someone help please,
I'm trying to use this module (https://github.com/jaredhanson/passport-instagram) to add sign/signup with Instagram to my angular-fullstack app but I'm getting the following error when trying to run the app.

It's a road-block for me right now as I have spend a long time searching all over the web for any possible tips on how to go about debugging the issue, but no luck so far, could someone be generous enough to give me some guidance as what could possibly be wrong or how to fix this...?

Note: My app is passing the clientID and the secret via the server > config > environment > index.js file.

  instagram: {
    clientID: process.env.INSTAGRAM_ID || 'instagram client id goes here',
    clientSecret: process.env.INSTAGRAM_SECRET || 'instagram secret goes here',
    callbackURL: `${process.env.DOMAIN || ''}/auth/instagram/callback`
  }

Thank you so much,
Regards,

/myapp/node_modules/passport-oauth2/lib/strategy.js:82
  if (!options.clientID) { throw new TypeError('OAuth2Strategy requires a clientID option'); }
                                 ^
TypeError: OAuth2Strategy requires a clientID option
    at Strategy.OAuth2Strategy (/myapp/node_modules/passport-oauth2/lib/strategy.js:82:34)
    at new Strategy (/myapp/node_modules/passport-instagram/lib/strategy.js:48:18)
    at Object.setup (/myapp/server/auth/instagram/passport.js:5:16)
    at Object.<anonymous> (/myapp/server/auth/index.js:11:33)
    at Module._compile (module.js:570:32)
    at loader (/myapp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/myapp/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.exports.default (/myapp/server/routes.js:15:20)
    at Object.<anonymous> (/myapp/server/app.js:34:1)
    at Module._compile (module.js:570:32)
    at loader (/myapp/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/myapp/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/myapp/server/index.js:12:28)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
[nodemon] app crashed - waiting for file changes before starting...

@Awk34
Copy link
Member

Awk34 commented Jan 19, 2017

The clientID you're passing to the passport strategy is falsey. Check where your code is grabbing it. console.log out your config.instagram.clientID.

@Awk34 Awk34 closed this as completed Jan 19, 2017
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