Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use service account with google cloud print [duplicate]

I have an application that uses google cloud print. The printers are registered on a company google account. I have to change the application to use oAuth now and since the application runs as a service (no user involved) it seems I have to use Google service account. I created a service account from the google account that owns the cloud print printers.

I can authenticate and issue submit commands, but the submit fail with user not approved which I suspect is because the service account does not actually own the printers.

Have anyone used google cloud print with oAuth, Service account and c# and can confirm it actually works?

like image 797
Jonas Røineslien Avatar asked Dec 24 '22 18:12

Jonas Røineslien


1 Answers

I had the same problem and I came to the same conclusion as you: the service account does not own the printers. I found a solution here: https://stackoverflow.com/a/19951913/3122797

Basically, what you have to do is share your printers account with your service account. The problem is that the service account must accept the sharing, which is not possible. The alternative solution proposed by dexter - which I successfully tried - is

  1. Create a Google Group from your printers account
  2. Add your service account to this group
  3. Share the printers with this Google group (using the group e-mail address)

Thus, the sharing works, and so do the API calls to Google Cloud Print.

like image 173
mon Avatar answered Dec 27 '22 19:12

mon