4

I've been trying to find a way to interact with Google's API (specifically, the Compute Engine API) without having the user authorise via a consent screen each time I need to reauthorise with Google.

The requests will be made when no user is present, so not having to authorise via a consent screen is an absolute must.

I'm using Go and the Go API Client Library.

Can anybody explain a method to achieve what I need to?

2
  • 3
    have you read developers.google.com/accounts/docs/OAuth2, the section about Applications on limited input devices
    – fabmilo
    Commented Aug 12, 2014 at 0:08
  • What is triggering the re-authorise request? Is the original authorisation timing out?
    – Bryan
    Commented Aug 13, 2014 at 11:11

1 Answer 1

3

You should take a look at service accounts. They utilize the public/private key pair to authorize calls to Google API.

Google Developers has one very nice document explaining how service accounts work:

https://developers.google.com/accounts/docs/OAuth2ServiceAccount

Here's how generate a service account:

https://developers.google.com/console/help/new/#serviceaccounts

You will also find the code samples in the first doc, but unfortunately not in Go. However, there are some comments that I found here:

https://code.google.com/p/google-api-go-client/wiki/GettingStarted

Hope it helps.

Not the answer you're looking for? Browse other questions tagged or ask your own question.