简体   繁体   English

Google Cloud Print API:需要用户凭据

[英]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.

相关问题 Cloud Firestore 和 Google Cloud 凭据 - Cloud Firestore and Google Cloud Credentials Google Cloud Print API - 打印PDF时的白页 - Google Cloud Print API - white page when printing PDF 来自 Google Cloud Monitoring API 的打印机类型 - Print machine type from Google Cloud Monitoring API Google Cloud Platform SQL 实例将不接受使用自定义用户凭据的 **nodejs 应用程序** 连接 - Google Cloud Platform SQL instance won't accept **nodejs application** connections using custom user credentials “无法加载默认凭据”谷歌云机密管理器 - 使用 CLI 授权用户 - "Could not load default credentials" google cloud secrets manager - use CLI authorized user Google 云存储 ApiError:必需 - Google cloud Storage ApiError: Required 无需提供凭据即可访问 Google Cloud Storage? - Google Cloud Storage access without providing credentials? 将 Google API 凭证与应用程序一起分发是否安全? - Is it safe to distribute Google API credentials with apps? Google Maps Tracks API 401无效的凭据 - Google Maps Tracks API 401 Invalid Credentials Google Drive API - 服务帐户凭据无效 - Google Drive API - Invalid service account credentials
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM