OAuth login with Google and Facebook not working

(Ali) #1

We installed 1.7.0.beta4 on a Digital Ocean droplet. Everything is working great, except for signup via Facebook and Google Logins (haven’t tried others). The user authorization process works fine (Sign Up --> Redirect to Google or Facebook --> User clicks Approve --> Redirects back to Discourse), and the Discourse app is added successfully to the Google / Facebook user accounts; but once user returns to Discourse, this error message is displayed, and no user is created in Discourse:

“Sorry, there was an error authorizing your account. Perhaps you did not approve authorization?”

There’s nothing in browser debug Console/Network that suggests what the problem is. Here’s a snapshot of the Console output after a Facebook sign up attempt:

Our configurations are as follows:




(Jeff Atwood) #2

Are you on the very latest code? @sam did anything change here recently that would affect both forms of login?

(Ali) #3

We’re on 1.7.0.beta4 which the Admin page is showing as the latest

(Jeff Atwood) #4

No, I mean did you do an /admin/upgrade or ssh in and upgrade via console – those are the weekly or bi-weekly versions. I need you to be on the very latest.

(Ali) #5

Will do that right now. Last update happened few days ago via admin dashboard (/admin), not ssh

(Sam Saffron) #6

Nope nothing changed that should cause that, oauth for google is untouched

(Ali) #7

Just finished updating to the latest:

discourse is at the newest version (91dac00).

Tried both Facebook and Google logins, got the same error as before.

(Ali) #8

More info from /logs:

(facebook) Authentication failure! invalid_credentials: OAuth2::Error, : {“error”:{“message”:“Error validating client secret.”,“type”:“OAuthException”,“code”:1,“fbtrace_id”:“EQVw10P6XXz”}}

(google_oauth2) Authentication failure! invalid_credentials: OAuth2::Error, {“errors”=>[{“domain”=>“usageLimits”, “reason”=>“accessNotConfigured”, “message”=>"Access Not Configured. Google+ API has no

(Ali) #9

@sam @codinghorror Solved the issue.
I was getting the same generic error message upon failure, which made it seem like it’s the same issue on both sides.
The error was with the config (enabling Google+ API and Contacts API on Google, and incomplete secret code on Facebook!) and the /logs page saved the day
Sorry for the false alarm!

(Tom Ruh) #10

Ali, I am getting the same error, can you explain your solution to me a little better?