Goodreads Developers discussion

124 views
questions > OmniAuth Gem for Rails — /auth/failure?message=invalid_response

Comments Showing 1-11 of 11 (11 new)    post a comment »
dateUp arrow    newest »

message 1: by Michael (last edited Sep 05, 2011 07:43PM) (new)

Michael (gruen) | 8 comments Devs—

I'm trying to get OAuth to work on a 1.9.2-p180 rails 3.1 app with the omniauth gem and the built-in goodreads strategy.

I'm getting an /auth/failure?message=invalid_response after my logger shows the proper /auth/goodreads/callback?oauth_token=XXXX&authorize=1, but it seems there's a problem in either the gem or the middleware, and debugging this is currently beyond my skill set. I'm running this on 0.0.0.0:3000, and am getting the same error with localhost and 127.0.0.1. Out of the box, the facebook and twitter strategies work; it seems to be a goodreads strategy issue.

My keys seem valid: changing a character in the key leads to invalid_credential message.

Anyone have any insight while I learn myself some rack middleware? I'd like to get back to building the actual application.

Thanks!


Edit: I'm using gem 'omniauth', "0.3.0.rc3".


message 2: by Michael (new)

Michael Economy (michaeleconomy) I haven't tried omniauth with goodreads.

If goodreads is your only auth provider, then it might be easier to use raw oauth. I've got an example up and running (https://github.com/michaeleconomy/boo...).


Can you post more data, including your callback handler action?



Have you gotten omni auth working with other partners?

I've only used it with facebook (example: https://github.com/michaeleconomy/gam...).


message 3: by Michael (new)

Michael (gruen) | 8 comments I intend to take google, facebook, and twitter sign-ins with the idea of getting them on goodreads, so it would be helpful.

Facebook and twitter worked out of the box.

My callback handler is the rack middleware that I'm unfamiliar with. On the controller end, I have a sessions controller with callback method that works (I can render rails.env['omniauth.auth']) whereas with goodreads, I get a failure from the rack app and goes to the failure method and with nil omniauth.auth environment information.

Give it a whirl; it'll take 2 seconds to build that.


message 4: by Michael (new)

Michael (gruen) | 8 comments Michael— here's what I started doing:

http://blog.railsrumble.com/blog/2010...

Note that the hash key on request.env is no longer rack.auth but is now omniauth.auth.


message 5: by Michael (new)

Michael Economy (michaeleconomy) It's probably going to be a little while before we can look into this a little deeper.


Sorry!


message 6: by Michael (new)

Michael (gruen) | 8 comments Like a day a week or a month?


message 7: by Michael (new)

Michael Economy (michaeleconomy) Probably 1-2 months :(


message 8: by Michael (new)

Michael Economy (michaeleconomy) We're pretty short on developer time at the moment, unfortunately.


message 9: by Michael (new)

Michael (gruen) | 8 comments Michael wrote: "We're pretty short on developer time at the moment, unfortunately."

Type faster! ;)


message 10: by Michael (new)

Michael (gruen) | 8 comments I fixed it!

For the record, MultiXml.parse returns a hash, not some slick data object.


message 11: by Michael (new)

Michael Economy (michaeleconomy) Cool!


back to top