Update 1: as I delve deeper, this isn’t really anything to do with Rails, it’s more of a question about how to have a server access our account using credentials provided by Google when the API we’re calling doesn’t support the Service Model
I have a server application that needs to connect to Google API from Rails. I can authenticate with OAuth2 successfully using the google-api-ruby-client gem and get other APIs working. There are several samples that use the gem, but most assume you want a user to authenticate themselves in a web environment. Others support what Google calls a “Service Model” where it’s really the app validating itself. I have that working, too.
However the specific API I am querying is Google Affiliate Network (GAN), which does not support the Service Account model. In particular, I need a server to be able to authenticate with OAuth2 without any user interaction. I have done this using OAuth in several other contexts, but am struggling to get it working in this case.
Does anyone know of working Rails code for GAN?
Update 2: I am searching this google document on API authorization for strategies that don’t require user interaction.
I found a workable solution — it uses Google’s “Installed Application” approach, which needs one bit of manual setup, but is otherwise a working solution.
https://gist.github.com/3543368