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)
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.
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.
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!
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With