How to solve this error `Sorry, there was an error authorizing your account. Perhaps you did not approve authorization?`


(Sameer Yadav) #1

I’m getting following error, while activating user account.

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

URL on which I’m getting error.

http://local.demo/users/activate-account/cool_number


(Jeff Atwood) #2

@techapj under what circumstance would this error appear? I do not recognize this text.


(Mittineague) #3

It’s in config/locales/server.en.yml under login:
omniauth_error: "Sorry, there was an error authorizing your account. Perhaps you did not approve authorization?"

I don’t know exactly what would trigger an omniauth error, but it looks to have something to do with app/controllers/users/omniautth_callbacks_controller.rb

  def failure
    flash[:error] = I18n.t("login.omniauth_error")
    render layout: 'no_ember'
  end

(Arpit Jalan) #4

This error is shown when the user tries to sign up via social login (Google/Facebook/Twitter) and the login fails, or if the user presses Deny instead of Allow.

@Sameer_Yadav make sure that you have correctly set up app key/secret here: https://discourse.example.com/admin/site_settings/category/login

Also, I see that you are testing on your local system? See:


(Sameer Yadav) #5

Thanks for reaching out.
@techAPJ, even after uploading site to live. I’m getting this error.

Also after facebook signup, users are not getting autologin.
Even email is not getting pulled from facebook, only name box gets name and username gets generated on basis of name.

Pardon for English.


(Wesley) #6

Not sure if you were trying to get this to work with Google as the auth provider but I realised that you need to enable access to the Google+ API too:

Under “APIs & auth” > APIs, you’ll see a huge list. Find “Google+ API” and enable it.


(Chethan Thimmappa) #7

I am facing this issue. The Google oAuth works only for first 24/hours. There after, I keep seeing either this message or server 500 message :frowning:

Can someone please look into this… It is very strange it works only for first 24 hours? Problem from Google?


(Jeff Atwood) #8

I know we updated some omniauth dependencies here @sam should people be urged to upgrade to latest based on that?


(DiscourseofLife) #9

@codinghorror I am also receiving this error for the Discourse OAuth Basic Plugin. I am sure that my parameters are correct, yet I receive “Sorry, there was an error…”


(Sam Saffron) #10

Update to latest we recently downgraded our oauth plugin due to


(Evan Chan) #11

@wesnolte and all,

Thanks for the tip but I realize I had to also enable “Google+ Domains API”. Both have to be enabled to work.


(Matt Taylor) #12

Enabling the APIs from the Google Dashboard called Google+ APIs and Google+ Domain APIs as specified by @evanfchan and @wesnolte fixed this problem for me just now.


(Nhumrich) #13

That fixed it for me. Thanks


(Ringgit Malaysia) #14

I am getting this as well when I am setting up the login via Facebook.
I have double checked all the doc in Discourse and I believe my config is correct. Yet FB does not allow me to go in due to the message URI not whitelisted. I suspect the root is due to the call back error: http://forum.loopgit.com/auth/facebook/callback which will result in the error message provided by OP.


(Ringgit Malaysia) #15

whoa, my problems was solved!
The only thing I did was to go to GoDaddy, and create a A record to point the URL to the IP address.
(I have an issue where accessing my forum using the URL, the browser will display IP address. Once this is fixed, my FB issue is also fixed!)


(David Lee) #16

I’m getting a similar problem with the github SSO. It seems to work only if (1) the user has already been registered in the normal way; and (2) they’re authorising the discourse oauth on github for the first time. Otherwise, I get the same error: “Sorry, there was an error authorizing your account. Perhaps you did not approve authorization?”.


(Swati Gupta) #17

Hi,

I am getting the same error when trying sso with discourse-saml plugin. IDP Initiated SSO is working but SP initiiated sso is throwing this same authorization error.

It seems omniauth callback controller not able to read saml response.

Please suggest, what could be the reason as all configurations are correct.


(Alex Choi) #18

Thanks for your tip! It works!


(Nima Faizy) #19

Hi @sam
I have another problem with authentication. Whenever I want to log in with my user and pass the authenticate popup page for login with (Google) will show.
I disable Google authentication from settings but the popup will show again with git hub. I don’t know exactly what happen here?

Please help me tnx.

P.S.: I installed linkedin authentication plugin too.


(Vincent) #20

This seems to be a regression:

Reverted 15 minutes ago so you should be fine after a simple rebuild.