问题标签 [service-accounts]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1247 浏览

ruby-on-rails - 使用 Google 服务帐户创建的新日历活动未向与会者发送邀请电子邮件

我正在使用Google 的服务帐户在 Google 日历中创建一个新活动,并且我也将sendNotifications设置为 true,但是创建活动后,邀请电子邮件没有发送给与会者??

0 投票
1 回答
934 浏览

oauth-2.0 - How to get a Bearer access token for Service Accounts

I have generate credentials for a service account like this:

the print display the credentials in json format :

This generate a private key ans access token that is null.

Is there a class that handels REST request specified here to get the access token ?

0 投票
1 回答
1322 浏览

java - 使用 GAE 服务帐户的 Gmail Java API

我正在尝试使用 GAE 服务帐户阅读 gmail 消息。类似于下面的代码可以很好地读取 Google 日历,但无法读取 gmail。我在域中只有一个用户(也是管理员帐户)。我正在尝试访问该用户的 gmail)。关于我的代码为什么失败的任何帮助都会很棒。

我已为以下范围委派了域范围的权限。

我在 Google App Engine 中启用了以下 API:

下面是创建 gmail 服务的代码:

读取 gmail 消息的代码:

执行此代码时出现以下错误

0 投票
1 回答
136 浏览

google-apps-marketplace - Google Apps Marketplace:我们如何在客户组织中找到我们的应用程序被授权的所有用户?

我们的客户正在为特定的子组织安装我们的 App Marketplace 应用程序。我们如何获得这些用户的列表?一旦我们得到该列表(电子邮件地址),我们就可以使用服务帐户来访问他们的资源。另外,有什么方法可以获取我们的应用程序有权访问的组织单位的名称?

0 投票
1 回答
647 浏览

google-analytics - Google Analytics - Access custom segments through Service Account

My application needs to fetch Google Analytics data from backend servers.

I am using Google Service Account in my application. Though I have given all permissions to my service account through Google Developer console, it turns out that my service account cannot access custom segments of my user account.

A way could have been to copy these segments from user account to service account, but there seems like no way to login via service account and be able to copy segments from user account to service account.

So, there seems like no way to be able to fetch custom segments in a web application from backend...

Is there any way to do so? Can any other account(web application, Installed application account) serve my purpose? Reading the documentation of above two Google accounts reveals that user would be prompted for authentication (at least once) during authorization in these 2 accounts which is not feasible in backend servers.

I found a similar thread for my query Google Analytics V3 - How to create custom segments for API Service Accounts , but user in this thread resorted to not using segments at all, but I do need to use them in my account.

PS: I am writing my application in RubyOnRails and would be using Ruby Gem for Google Authentication

0 投票
1 回答
3116 浏览

credentials - java.net.SocketTimeoutException:连接超时 + google 目录,管理 sdk API

使用服务帐户时出现 berlow 错误。相同的代码在本地运行良好,并且能够使用服务帐户创建凭据。

0 投票
1 回答
643 浏览

python - 使用 Google API 服务帐号获取所有域用户的日历列表

我创建了一个服务帐户并委派了域范围的权限。我正在尝试获取每个用户都可以访问的日历列表。有些用户的电子邮件可以拨打电话,有些则不能并返回无效请求错误。任何人都可以帮忙吗?

0 投票
1 回答
208 浏览

google-cloud-storage - Google Cloud Storage 的服务帐户身份验证适用于某些服务器,但不适用于其他服务器

我使用 google-api-java-client 访问 Google Cloud Storage API。它在我的本地机器和某些服务器上运行良好。但它在生产服务器上失败并出现 400 错误请求(错误:invalid_grant)。我在 Google Adwords API 上遇到了类似的问题,Google API Adwords Support 解决了这个问题。我认为他们只是将我使用的服务器的 IP 列入白名单。我是否可能需要在 Google Cloud Storage API 中添加权限?这会很奇怪,因为它可以在我的本地电脑上运行。

0 投票
1 回答
364 浏览

python - Google AppEngine with Service Account but invalid Credentials

I have tried to get a group settings with group settings API using Google App Engine 1.7.5 with python 2.5 following a simple example here. this is my app.yaml:

and my main.py is like following:

and this is the stacktrace telling me invalid credentials!

Have anyone got this error before or have an idea of the root cause?

0 投票
2 回答
766 浏览

python - 在 Python 中使用服务帐户创建 DfpClient

我使用 google DFP api 来收集关于我们网站上点击的广告的一些统计信息。
代码是用 Python 编写的。目前,我正在尝试升级代码以使用 oAuth 2。
由于代码每天自动运行,无需任何用户参与,因此我
在我的 google 项目下创建了一个服务帐户,并将该帐户添加到
我们公司的 DFP 广告管理系统网络。根据网上的示例代码,我写了这个:

这段代码似乎不正确,因为代码中的任何地方都没有传递 network_code。此外,它失败并显示以下消息:

apiclient.errors.UnknownApiNameOrVersion:名称:dfp 版本:v201411。

此外,下面的行:

不适用于我的情况,因为这是基于 googleads.yaml 的,它似乎仅针对具有客户端密码而不是 P12 私钥的 Web 应用程序帐户进行格式化。

有什么建议吗?谢谢。