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

Unable to authenticate with passport-google-oauth20 #295

Closed
EugeneZ opened this Issue Sep 24, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@EugeneZ
Copy link

EugeneZ commented Sep 24, 2016

I can't seem to get Google OAUTH2 working. I thought it must be me, so I took the feathers-oauth2-authentication project from the feathers-demos repo, which uses GitHub, and ran it. It worked. I replaced the passport-github package with passport-facebook (which is very similar to Google's), replaced the link in index.html, changed github to facebook in the configuration object, and updated the ids. This also worked. I performed the same exact steps but with the passport-google-oauth20 package. It gets as far as Google's page asking me for permission to see my public profile, etc, but when I approve, the callback that it redirects to forwards me to the failure page. Looking at the redirect, it looks like Google did the right thing and forwarded state=true and some sort of token, just like Facebook does. Any ideas?

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Sep 24, 2016

@EugeneZ have you tried using the generator and letting it build the Google OAuth setup for you?

@EugeneZ

This comment has been minimized.

Copy link
Author

EugeneZ commented Sep 25, 2016

I did not, but I just went and set it up. All I did was set up a new repo, babel (as per the guide), feathers generate with all defaults except google for auth and memory for db. Added my oauth ids to the config and added a link to /auth/google to index.html. No good, same exact problem... Google asks for password and then forwards to callback, which then forwards to failure.

@EugeneZ

This comment has been minimized.

Copy link
Author

EugeneZ commented Sep 25, 2016

Ever had that thing where shortly after opening an issue you figure out the problem even though you thought you tried everything before opening it? Yeah. That. Sorry!

For those interested, turns out you have to enable the Google+ API from your API dashboard (I had to also enable the Gmail API, might be the permissions I'm requesting). See here: jaredhanson/passport-google-oauth#46

@EugeneZ EugeneZ closed this Sep 25, 2016

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Sep 25, 2016

Glad you got it worked out
On Sat, Sep 24, 2016 at 11:31 PM EugeneZ notifications@github.com wrote:

Closed #295
#295.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#295 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAH3WVqlQ_71wNvTN0cxWPeHl_TfL6dYks5qtgdEgaJpZM4KFvLD
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.