9

I'm creating an app that prints out a pdf from the server after it has been generated.

When using google cloud print I keep getting:

User credentials required
Error 403

Note: making this print request in the simulating page works fine, but that's because I'm already logged into my google account.

After doing some research I found out I need to use OAuth to get an access token to send with the request to make a print job.

And every single page I can find tells me to redirect me to: https://www.googleapis.com/auth/cloudprint, which gives me a 404 error, neither can I find it in the google playground, and using any older versions of authentication ends up in the request to sign in being flagged as an attack from a hacker.

Is there any way around this?

Paradoxis
  • 4,471
  • 7
  • 32
  • 66

1 Answers1

8

I was stuck on this for a while. The docs don't tell you which scope to use or how to use it. I haven't implemented a Google API using OAuth2 yet, so I didn't have an understanding of how the scoping works.

It turns out the scope is just the base API route for CloudPrint.

To make sure your refresh_token or access_token is scoped properly to use the CloudPrint API you need to use have the following string in your scope object:

https://www.googleapis.com/auth/cloudprint

Jonathan
  • 5,495
  • 4
  • 38
  • 53