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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top