Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Share printer with Google API Service Account

Is it possible to share a GCP printer with a Google API service account (https://developers.google.com/accounts/docs/OAuth2ServiceAccount)?

I tried to share the printer with the client email address ([email protected]), but the printer is not shown in the response to the API call /search. Calling /submit leads to an error (User has no access)

like image 347
Chris Avatar asked Nov 04 '13 12:11

Chris


People also ask

Why did Google discontinue Cloud Print?

In November 2019, Google announced end of support for Google Cloud Print on December 31, 2020. Google cited improvements in native Chrome OS printing as well as a marketplace of other print solutions providers in its decision to terminate the service.

Is Google Cloud Print being discontinued?

Google Cloud Print was deprecated in January of 2021 and is no longer supported. Devices across all operating systems will not be able to print using Google Cloud Print. We recommend that you find an alternative print solution and migrate your print services.


2 Answers

As you yourself shared the printer with the service account, we can assume you know the "Printer ID" of the printer to which the service account has been invited.

Have the service account call the /processinvite request, with these (mandatory) parameters:

  • printerid = the-known-printer-id
  • accept = true

After that, the printer will appear in /search

Happy printing!

like image 115
jr997 Avatar answered Oct 21 '22 08:10

jr997


I believe you are encountering the "is pending" problem.
Namely, you did share your printer with the [email protected] account but the other user (in this case [email protected]) has to accept the invitation to share the printer.

You can check this by issuing the /print request and you will see an

"is_pending": true

element in the access section for your user ([email protected]) in this case.

Needless to say that accounts that have this element set to true cannot print - hence the "User is not authorized." message.
I know no way to accept the invitation for the given service account however there is a workaround:

  1. You can create a private google group with an account that can accept shared printers (e.g. your gmail account).
  2. Then you add the service account ("[email protected]") to the group et voila. You can print with the service account ;).

When you share the printer you must share it with the google group (use the group's email address which you can find somewhere in the group management console) and the group manager (e.g. your gmail account) must accept the invitation for the whole group.

More info on how to create the group can be found here.
I have tried this with a GAE service account and it works. If you need any clarification do not hesitate to ask. Good luck.

like image 36
dexter Avatar answered Oct 21 '22 06:10

dexter