Tag: google api

从Firebasefunction访问Google Site Verification API

我正在尝试使用Node.js的Firebase函数使用Google Site Verification API 。 Github的google-api-nodejs-client存储库中提供的READMEbuild议使用默认的应用程序方法,而不是手动创buildOAuth2客户端,JWT客户端或计算客户端。 我写了下面的例子,我尝试在本地(模拟function环境)上运行,并在Firebasefunction上远程运行: const google = require('googleapis'); google.auth.getApplicationDefault(function (err, authClient, projectId) { if (err) { console.log('Authentication failed because of ', err); return; } if (authClient.createScopedRequired && authClient.createScopedRequired()) { authClient = authClient.createScoped([ 'https://www.googleapis.com/auth/siteverification' ]); } const siteVerification = google.siteVerification({ version: 'v1', auth: authClient }); siteVerification.webResource.get({ id: 'test.com' }, {}, function (err, data) […]

在使用webmaster.searchanalytics API for Node时获取backendError 500

尝试使用webmaster.searchanalytics api时出现以下错误: { Error: Backend Error at Request._callback (/home/tom/Programming/MagpieMicroService/node_modules/google-auth-library/lib/transporters.js:85:15) at Request.self.callback (/home/tom/Programming/MagpieMicroService/node_modules/request/request.js:186:22) at emitTwo (events.js:125:13) at Request.emit (events.js:213:7) at Request.<anonymous> (/home/tom/Programming/MagpieMicroService/node_modules/request/request.js:1163:10) at emitOne (events.js:115:13) at Request.emit (events.js:210:7) at IncomingMessage.<anonymous> (/home/tom/Programming/MagpieMicroService/node_modules/request/request.js:1085:12) at Object.onceWrapper (events.js:314:30) at emitNone (events.js:110:20) code: 500, errors: [ { domain: 'global', reason: 'backendError', message: 'Backend Error' } ] } 代码如下: 'use strict'; var […]

Firebase – NodeJS:用于Google API的OAuth2域范围委派

目标: 此Firebase云端function应使用Cloud API与域范围委派,以便任何用户在Firebase数据库更改时更新一些 G Suitepipe理控制台用户信息。 题: 我应该使用哪个包的方法来获得应用程序的广泛代理权。 firebase : firebase.auth.GoogleAuthProvider() googleapis : google.auth.OAuth2 google-auth-library : new GoogleAuth() 细节: 关于Google Identity Platform ,我并没有把这个问题连接起来,而我却陷入了这一步 。 firebase托pipe的nodejs应用如何将Google API请求的Web和访问令牌放在一起? Firebase项目使用Google云端平台项目 我有… 通过GCP-Console中的API /凭证添加到项目中的service account actor 选中启用G Suite域范围委派框 存储private_key.JSON。 授权API客户端(位于G Suitepipe理控制台中)和服务帐户客户端ID 我应该使用… Firebase :可能会查看Google OAuth2设置的白名单区域 ,和/或使用我从firebase获得的services.json 。 Google API通过googleapis :尽pipe我使用firebase.auth.GoogleAuthProvider()来validation用户,也许可以使用google.auth.OAuth2从GCP获取域范围的委派(如应用程序或计算引擎) Google Auth通过google-auth-library :同样,即使我使用firebase.auth.GoogleAuthProvider()来validation用户,也许使用new GoogleAuth()从GCP获取域范围的委托(如应用程序或计算引擎) 更新 我学过: Google的npm包googleapis不适用于客户端(浏览器)。 我现在正尝试在Firebase云端函数中使用它

使用Google API的Firebase – 需要帐单和/或身份validation

目标 使用免费的Firebase Spark计划 ,在Firebase云端function中使用googleapis 。 上下文 我已经将以下云端function代码部署到了我的Firebase项目中。 helloWorld端点按预期工作。 urlShortener端点返回两个错误: Error: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup… 和 Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions 题 如果我发送一个validation的请求,这是否certificate了这两个错误? 或者,googleapis以某种方式被视为External network并且必须解决这两个错误,例如,打开结算以使用googleapis? 码 const functions = require('firebase-functions'); const admin = require('firebase-admin'); […]

谷歌stream行时间在nodejs

谷歌提供了最新的Api“stream行时代”,以获取关于特定时间的特定时间的数据,或者正在忙碌或stream行。 但是它带有python实现。 有没有人知道一个方法来使用谷歌stream行时间api Node.js项目内? https://github.com/m-wrzr/populartimes这个链接让你获得一个Python代码..如何包含或如何获得节点项目的api

Google Spread Sheet – – Node.js

我正在开发一个Node.js应用程序,我将要求用户使用他们的Google ID进行身份validation 一旦用户完成身份validation,我的应用程序将在用户的帐户中创build一个谷歌电子表格。 我应该开始查看Google Drive API还是应该开始查看电子表格api? Node.js中是否有可用的模块? 如何使用Googlelogin身份validation用户? 编辑 – 4。 如果我必须代表用户,服务帐户或客户端ID创build电子表格,应该创build什么types的API访问权限? 这两者有什么区别?

Node.js oauth2模块用于无标头检索访问令牌

我知道我已经跑过这个,但我似乎无法find它了。 是否存在允许在没有浏览器的情况下检索Google API访问令牌的Node.js模块? 我想在无头服务器上对Google API进行身份validation请求。 然而,我发现的模块都需要一个浏览器。 是否存在一个模块,所有这些都可以在服务器上完全处理?

Chrome网上应用店“您无权访问App ID的许可数据:”

我有一个离线的Chrome Web应用程序,我想通过networking商店销售。 它有一个服务器后端。 我希望服务器检查许可证数据。 我怎么做? 这是API 。 这是一个Java HowTo 。 以下是nodejs的OAuth-JWT库 。 我在lib的自述文件中描述了一个新的client-id。 我得到这个回应: { error: { errors: [ [Object] ], code: 403, message: 'You don\'t have access to licensing data for App ID: aaaaaaaaaaaaaaaaaaaaaaaaaaaa' } } 如何在我的服务器上访问我的应用程序的许可证数据? 麦克风 代码如下: var appId = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; var userId = '1111111111111111111111'; // obtain a JWT-enabled version of request […]

节点:使用查询列出所有文件的Google Drive API

我是否可以知道如何使用GoogleAPIS库在Google云端硬盘中查询使用查询的所有文件? https://github.com/google/google-api-nodejs-client/ 我不知道,如何使用这个库! 我不知道我应该把我的查询,我已经尝试了下面的代码,但我没有得到任何回应.. testing1: drive.files.list("mimeType='image/jpg'", function(data){ //I am getting all the data, the query is not working.. )); testing2: drive.files.list({ media: { mimeType: 'application/vnd.google-apps.folder' } }, function(err, data){ //I am getting all the data, the query is not working.. }); testing3: drive.files.list({ resource: { mimeType: 'application/vnd.google-apps.folder' } }, function(err, data){ //This returns error not […]

如何获得谷歌网站pipe理员API访问令牌(Node.js)

我需要访问令牌提交站点地图。 我用这样的护照 passport.authenticate('googleApi', {scope: ['profile', 'https://www.googleapis.com/auth/webmasters']}); 并得到 { code: '4/aEzOOw1j-1rNCXCVajylMVRasdo2Kasdreisasdradk.MijA9hPKsg8WYFZr95uasdUzab8UkwI' } 在request.query中 但是这个令牌根据无效 https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=MY_TOKEN 提前致谢。