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

500 error on google auth #141

Closed
digitaldesigndj opened this issue Sep 15, 2015 · 3 comments
Closed

500 error on google auth #141

digitaldesigndj opened this issue Sep 15, 2015 · 3 comments
Labels
Milestone

Comments

@digitaldesigndj
Copy link
Contributor

@digitaldesigndj digitaldesigndj commented Sep 15, 2015

I have bell working perfectly for Twitter authentication, but when I try to auth with Google, the server was just quitting with a 500 error. After adding { debug: { request: 'error' } } to my Hapi server.config, I get the below errors, but I can't make heads or tails of it...

150914/230842.726, [response], http://localhost:8001: get /login/google {} 302 (26ms)
Debug: auth, unauthenticated, error, google
    Error: Failed obtaining google user profile
  at Object.exports.create (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/boom/lib/index.js:21:17)
  at Object.exports.internal (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/boom/lib/index.js:262:99)
  at /Users/taylor/www/auth.hyprtxt.com/node_modules/bell/lib/oauth.js:274:43
  at /Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:454:20
  at finish (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:284:20)
  at wrapped (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/hoek/lib/index.js:858:20)
  at [object Object].onReaderFinish (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:346:16)
  at [object Object].g (events.js:199:16)
  at [object Object].emit (events.js:129:20)
  at finishMaybe (_stream_writable.js:484:14)
  at endWritable (_stream_writable.js:493:3)
  at [object Object].Writable.end (_stream_writable.js:459:5)
  at IncomingMessage.onend (_stream_readable.js:505:10)
  at IncomingMessage.g (events.js:199:16)
  at IncomingMessage.emit (events.js:129:20)
  at _stream_readable.js:908:16
  at process._tickDomainCallback (node.js:381:11)

Debug: internal, error
    Error: Failed obtaining google user profile
  at Object.exports.create (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/boom/lib/index.js:21:17)
  at Object.exports.internal (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/boom/lib/index.js:262:99)
  at /Users/taylor/www/auth.hyprtxt.com/node_modules/bell/lib/oauth.js:274:43
  at /Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:454:20
  at finish (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:284:20)
  at wrapped (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/hoek/lib/index.js:858:20)
  at [object Object].onReaderFinish (/Users/taylor/www/auth.hyprtxt.com/node_modules/bell/node_modules/wreck/lib/index.js:346:16)
  at [object Object].g (events.js:199:16)
  at [object Object].emit (events.js:129:20)
  at finishMaybe (_stream_writable.js:484:14)
  at endWritable (_stream_writable.js:493:3)
  at [object Object].Writable.end (_stream_writable.js:459:5)
  at IncomingMessage.onend (_stream_readable.js:505:10)
  at IncomingMessage.g (events.js:199:16)
  at IncomingMessage.emit (events.js:129:20)
  at _stream_readable.js:908:16
  at process._tickDomainCallback (node.js:381:11)

150914/230844.382, [response], http://localhost:8001: get /login/google {"state":"lcplHnH_rSR05KuTNYm08I","code":"4/raIYmG3uYWFG737G50tEyYvb7hQqYeTe27CTmmn_uDY"} 500 (743ms)
@digitaldesigndj

This comment has been minimized.

Copy link
Contributor Author

@digitaldesigndj digitaldesigndj commented Sep 15, 2015

I tried to add some console.log's to my handler and validation functions, but they never seem to get called...

@ldesplat

This comment has been minimized.

Copy link
Contributor

@ldesplat ldesplat commented Sep 15, 2015

Put a console.log(err, response) at https://github.com/hapijs/bell/blob/master/lib/oauth.js#L273.
Just go into your node_modules/bell/oauth.js and modify it directly. Maybe there will be more information.

If I have to guess though it is because of the following:

You must also enable the Google+ API in your profile. Go to APIs & Auth, then APIs and under Social APIs click Google+ API and enable it.

I should add this to the Providers.md documentation for the Google one.

I can take a PR for it too if that fixes your problem!

@ldesplat ldesplat added this to the 5.1.1 milestone Sep 15, 2015
@digitaldesigndj

This comment has been minimized.

Copy link
Contributor Author

@digitaldesigndj digitaldesigndj commented Sep 15, 2015

That's the ticket! Thanks for the help 👍

ldesplat added a commit that referenced this issue Sep 15, 2015
Closes #141
@ldesplat ldesplat modified the milestones: 5.2.0, 5.1.1 Sep 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.