-->

OAuth 2.0 And Google Cloud Print

2019-09-11 14:11发布

问题:

I created a project called: "projectprint-123"

https://console.developers.google.com/apis/credentials/oauthclient?project=projectprint-123

Credentials

Web application Name : projectprint-123

What to ask can the 1. Authorized JavaScript origins 2. Authorized redirect URIs Put EMPTY? Because I testing localhost. OK. I proceed to empty.

What is Oauth consent screen? I only fill in Email address at this part. OK. I proceed next.

Then I try

https://www.google.com/cloudprint/getauthcode? printerid=5e0db751-9498-677d-9cf3-3a7284978279&oauth_client_id=254414591833-7lg4a5nnnh009g9ccf613notg8vceunp.apps.googleusercontent.com

Fail:

{ "success": false, "message": "Unknown, used or expired token.", "request": { "time": "0", "params": { "oauth_client_id": [ "254414591833-7lg4a5nnnh009g9ccf613notg8vceunp.apps.googleusercontent.com" ], "printerid": [ "5e0db751-9498-677d-9cf3-3a7284978279" ] } }, "errorCode": 506 }

I using this APIGEE application to send

https://apigee.com/console/others?req={%22resource%22%3A%22https%3A%2F%2Fwww.google.com%2Fcloudprint%2Fgetauthcode%22%2C%22params%22%3A{%22query%22%3A{}%2C%22template%22%3A{}%2C%22headers%22%3A{%22headers_name_0%22%3A%22Content-Type%22%2C%22headers_value_0%22%3A%22application%2Fx-www-form-urlencoded%22}%2C%22body%22%3A{%22attachmentFormat%22%3A%22mime%22%2C%22attachmentContentDisposition%22%3A%22form-data%22}}%2C%22verb%22%3A%22post%22}

I appreciate if you can help. Thank you.