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

No route matches [GET] "/auth/google" #10

Closed
allochi opened this issue Dec 6, 2011 · 10 comments
Closed

No route matches [GET] "/auth/google" #10

allochi opened this issue Dec 6, 2011 · 10 comments

Comments

@allochi
Copy link

allochi commented Dec 6, 2011

Hi,

I hope it's the right place to talk about this. I need to this to work urgently (sorry for using that word)

I have a rails 3.1 application on ruby 1.9.3, I followed the example application here, and I also followed the railscasts one, but when I try to log in by calling /auth/google I get this error

No route matches [GET] "/auth/google"

I'm lost, since I use OmniAuth + openid + devise (3.1/1.9.3) in another application and it works, so I know there is nothing wrong with the service or accounts.

Please help.

@zquestz
Copy link
Owner

zquestz commented Dec 6, 2011

The route is /auth/google_oauth2 =)

@zquestz
Copy link
Owner

zquestz commented Dec 6, 2011

Closing, just a small syntax issue =)

@zquestz zquestz closed this as completed Dec 6, 2011
@allochi
Copy link
Author

allochi commented Dec 6, 2011

Many thanks! this works, now I have different error, but at least not this one :D

Could you help with this too :), although I'm using the "OAuth consumer key" and "OAuth consumer secret" by pasting them explicitly on the initializing file, I get the 400 OAuth 2.0 error: invalid_client. any idea?

Thanks!

@zquestz
Copy link
Owner

zquestz commented Dec 6, 2011

Can you paste your code snippet? Just tokenize the real values so I can see exactly how you inserted them? Also you set everything up at http://code.google.com/apis/console?

@allochi
Copy link
Author

allochi commented Dec 7, 2011

Thanks for replying

Initializer:

Rails.application.config.middleware.use OmniAuth::Builder do
provider :google_oauth2, '...c.ch', 'Yygc...+...g+...U...I5.k'
end

Do I have to set things up there? I used omniAuth + Devise + openID before without setting anything up there? I mean what if I only want people to verify who they are on google to use my web application? do I still have to do this?

By the way, does this means that I can't use localhost for my application too?

@allochi
Copy link
Author

allochi commented Dec 7, 2011

Ok, my mistake, it's right, the cilent id is wrong, I got it working now. by got it working that means I see the authorization page, and when I allow the application, I get different error now:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

but I will figure it out. I'm really thankful for your guidance!

@zquestz
Copy link
Owner

zquestz commented Dec 7, 2011

That is actually just a cert error for the httpclient. You can address this by either turning off validation, or making sure the certs are available.

To turn off validation just use:

OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE

@allochi
Copy link
Author

allochi commented Dec 7, 2011

Man, you are the best!!! this works now :D, how do I make sure that certs are available? assuming in real life application I have to do so for better security.

@zquestz
Copy link
Owner

zquestz commented Dec 7, 2011

There are a few ways to fix this. Here's a thread on stackoverflow.

http://stackoverflow.com/questions/4528101/ssl-connect-returned-1-errno-0-state-sslv3-read-server-certificate-b-certificat

Another blog offering a decent solution:

http://www.rubyinside.com/how-to-cure-nethttps-risky-default-https-behavior-4010.html

This is also useful:

http://stackoverflow.com/questions/3977303/omniauth-facebook-certificate-verify-failed

To fix directly in your provider line, just use the following and make sure the certs are there.

provider :google_oauth2, KEY, SECRET, {:client_options => {:ssl => {:ca_path => "/etc/ssl/certs"}}}

@jamiew
Copy link

jamiew commented May 15, 2012

Addendum on a different invalid_client issue I ran into. I have multiple client IDs setup in the Google API console. A short one like "555555555555.apps.googleusercontent.com"

And a longer one that has a hash appended to the original, like: "555555555555-xxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com"

The short one works; the longer ones do not. I couldn't find anything in their docs about this, and am not sure what the difference is. Hope this helps someone else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants