Question

I want to authenticate a user using google oauth2.

I followed the instructions and I arrived to this point:

https://developers.google.com/accounts/docs/OAuth2Login#exchangecode

Am I supposed to use this gem for that? https://github.com/google/google-api-ruby-client

Or should I make the post using plain ruby?

Was it helpful?

Solution

The google-api-ruby-client gem is designed to work with various Google APIs and takes care of the protocol stuff automatically. If you’re going through the steps in that link you have to keep going, the code-for-tokens step requires an HTTP POST. The code in https://github.com/google/favcolor-server/blob/master/rp.rb might be useful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top