[英]Google Cloud Print API: User credentials required
I'm trying to use the Google Cloud Print library to get a list of the cloud printers available to the users, but when I do a request I get an error: "User credentials required" 我正在尝试使用Google云打印库来获取用户可用的云打印机列表,但是当我发出请求时出现错误:“需要用户凭据”
This is how I send the request: 这是我发送请求的方式:
var request = require('request');
var options = {
url: 'https://www.google.com/cloudprint/search',
headers: {
'X-CloudPrint-Proxy': 'APP_NAME',
'Authorization': 'GoogleLogin auth=ACCESS_TOKEN_HERE'
}
};
function callback(err, response, body) {
console.log(err);
console.log(response);
console.log(body);
}
request(options, callback);
In order to make this work (as there is no exact documentation). 为了使这项工作(因为没有确切的文件)。
Add https://www.googleapis.com/auth/cloudprint to the scope of the login procedure. 将https://www.googleapis.com/auth/cloudprint添加到登录过程的范围。
If you look here: https://github.com/dpsm/android-print/blob/master/src/main/java/com/github/dpsm/android/print/GoogleCloudPrint.java 如果你看这里: https : //github.com/dpsm/android-print/blob/master/src/main/java/com/github/dpsm/android/print/GoogleCloudPrint.java
They want the Authorization to be Bearer ACCESS_TOKEN_HERE 他们希望授权成为持票人ACCESS_TOKEN_HERE
instead of GoogleLogin auth=ACCESS_TOKEN_HERE 而不是GoogleLogin auth = ACCESS_TOKEN_HERE
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.