Authenticating a Google Service Account
April 26, 2012 by Eric Richardson
I spent a few hours at work today trying to make sense of Google's new OAuth2 service accounts, implementing code to generate the JSON Web Token it wants and then query Google's auth server to get the OAuth token. Google intends the accounts to be used by backend services, which makes a lot more sense than shoe-horning them into access via some user's account as is normally the case.
Only after I had all that and I tried to make an API request did I realize that Google doesn't support service accounts in Analytics yet, so all of that work was in vain. To try to keep it from going to waste, I figured I would post it here. Looking to authenticate a Google service account for a Ruby app? Hopefully this will save you a little time.



