# OAuth login with Google and Facebook not working

**URL:** https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361
**Category:** Support
**Created:** [19 september 2016 om 22:46 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361 "2016-09-19T22:46:41Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 22:46 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/1 "2016-09-19T22:46:41Z")

</div>

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?”
> 
> ![](https://global.discourse-cdn.com/meta/original/3X/f/9/f9bef534883d4874107409ab603089d674029379.png)

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:

 ![](https://global.discourse-cdn.com/meta/original/3X/9/c/9c12b417a4a1dec3df81e3e5d78fbf2fecc3440f.png)

Our configurations are as follows:

**Facebook**

 ![](https://global.discourse-cdn.com/meta/original/3X/5/0/505c3fc41f88e756fbc130c9e9e2ab76f3d7b916.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/5/a/5a896bd2a2f645359a10ad34909b6184cd5bcc30.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/a/a/aaa99eee63b0a6ec336ee982f96856885869f50e.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/c/b/cbd392da59cb00ee92be0b4dc65a977ca963850b.png)

* * *

## **Google**![](https://global.discourse-cdn.com/meta/original/3X/f/b/fb23bb75de3cff158ad62c3303c4a749d1b562de.png) ![](https://global.discourse-cdn.com/meta/original/3X/e/8/e88b9a686ccfadeb7b059f5412717857eaad670a.png)

**Discourse**

 ![](https://global.discourse-cdn.com/meta/original/3X/9/b/9b02a93ea06ff4e04d40ac85a9fa69c81d639703.png)  
 ![](https://global.discourse-cdn.com/meta/original/3X/0/6/065b302225cc3018c97b5050df903e4ac183f885.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 september 2016 om 22:48 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/2 "2016-09-19T22:48:09Z")

</div>

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

---

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 22:50 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/3 "2016-09-19T22:50:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 september 2016 om 22:50 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/4 "2016-09-19T22:50:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 22:51 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/5 "2016-09-19T22:51:24Z")

</div>

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

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 september 2016 om 22:53 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/6 "2016-09-19T22:53:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 22:56 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/7 "2016-09-19T22:56:16Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 23:02 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/8 "2016-09-19T23:02:00Z")

</div>

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

---

<div class="post-metadata">

### Author: ![alik](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alik/32/114605_2.png) [@alik](https://meta.discourse.org/u/alik)
#### Post date: [19 september 2016 om 23:10 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/9 "2016-09-19T23:10:43Z")

</div>

@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!

---

<div class="post-metadata">

### Author: ![SpaceMonkey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/spacemonkey/32/98889_2.png) [@SpaceMonkey](https://meta.discourse.org/u/SpaceMonkey)
#### Post date: [23 juni 2018 om 16:48 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/10 "2018-06-23T16:48:53Z")

</div>

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

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [8 juni 2024 om 12:37 UTC](https://meta.discourse.org/t/oauth-login-with-google-and-facebook-not-working/50361/11 "2024-06-08T12:37:15Z")

</div>

This topic was automatically closed after 2818 days. New replies are no longer allowed.
