service-accounts

Providing keyFilename of Google Client Service Account from Google Cloud Storage

痞子三分冷 提交于 2021-02-19 08:15:29
问题 To connect to Google Cloud BigQuery that exists in a different GCP project from a Google Cloud Function, I am creating the BigQuery Client as follows: const {BigQuery} = require('@google-cloud/bigquery'); const options = { keyFilename: 'path/to/service_account.json', projectId: 'my_project', }; const bigquery = new BigQuery(options); But instead of storing the service_account.json in my Cloud Function, I want to store the Service Account in Google Cloud Storage and provide the Google Cloud

How to get delegated credentials objects for invoking google apis?

不想你离开。 提交于 2021-02-19 05:21:40
问题 I am trying to fetch gsuite alerts via API. I have created a service account as per their docs and I have assigned that service account to my google cloud function. I do not want to use environment variables or upload credentials along with source code but I want leverage default service account used by function. from googleapiclient.discovery import build def get_credentials(): # if one knows credentials file location(when one uploads the json credentials file or specify them in environment

Limit Firebase Cloud Function To IP Addresses

五迷三道 提交于 2021-02-17 06:17:04
问题 I have several Cloud Functions that are all setup and working well, each of type https.onRequest(... . I am trying to figure out the best / easiest way to allow the https.onRequest functions to be called only by specified IP addresses. Can this be accomplished? I am guessing I need to create a service account with conditions, but I haven't been able to achieve the results I want. 回答1: You could use a GCE VM as proxy with a firewall rule to only accept incoming traffic form the IP that you

Youtube live streaming API giving livePermissionBlocked error

╄→尐↘猪︶ㄣ 提交于 2021-02-11 12:20:24
问题 I am trying to setup youtube live streaming APIs using service account delegation. I have done all the necessary steps for service account delegation on my domain. I have a youtube channel owned by a user with email id of this domain name. Channel has more than 10k subscribers and has all the necessary permissions to live stream (I can live stream via youtube studio). While using youtube java APIs, i am getting this error : { "code" : 403, "errors" : [ { "domain" : "youtube.liveBroadcast",

java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J

霸气de小男生 提交于 2021-02-05 07:14:51
问题 I'm getting this "java.lang.NoSuchMethodError: com.google.common.io.ByteStreams.exhaust(Ljava/io/InputStream;)J" error while using ServiceCredentials.fromStream() method. Anyone here faced this and know a fix? TIA <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>[title]</groupId> <artifactId

Google Calendar api authentication via POST request

牧云@^-^@ 提交于 2021-01-29 16:52:47
问题 I am trying to issue a POST request towards the google calendar api, but I fail to understand how to authenticate it. I took the following steps to try and use a service account to do so: I've enabled the the calendar api in the Google Cloud console I've created a new service account, enabled G Suite Domain-wide Delegation , and downloaded the provided key. I've added the service account email to the calendar to be able to make changes and create events. I've tried to create a POST request to

Google Drive API Python Service Account Example

那年仲夏 提交于 2021-01-28 07:37:07
问题 Is it possible to authenticate against the Google Drive API using a Google Service Account, rather than an OAuth flow ? The Python examples for Google Drive use OAuth - Google drive Python Quick start However I can't find any Service Account examples. The majority of the other Google APIs I use (Translate, Cloud Vision) do use Service Account however, so I'd like to deprecate my Google Drive OAuth code for consistency. 回答1: The best service account python example that i know of is the one for

How can I retrieve a service account OAuth2 token from Google Api with Javascript?

和自甴很熟 提交于 2021-01-27 11:45:37
问题 I need to use a google projects service account to access google API using JavaScript. In order to do this I need to OAuth2 to google API servers to get an auth token. I understand that Google provides a library (GAPI) for use on node servers, but I need a solution that will work in other secure JavaScript environments. 回答1: There are two major divisions to this task. Configuring Coding First the Configuration steps. If you don't have a google account: Navigate to google.com Find and Click

How can I retrieve a service account OAuth2 token from Google Api with Javascript?

可紊 提交于 2021-01-27 11:43:02
问题 I need to use a google projects service account to access google API using JavaScript. In order to do this I need to OAuth2 to google API servers to get an auth token. I understand that Google provides a library (GAPI) for use on node servers, but I need a solution that will work in other secure JavaScript environments. 回答1: There are two major divisions to this task. Configuring Coding First the Configuration steps. If you don't have a google account: Navigate to google.com Find and Click

Error while creating google calendar event with a service account

穿精又带淫゛_ 提交于 2021-01-04 07:17:12
问题 I have a requirement of creating a google calendar event on a calendar and add other users as attendees to that event. The objective is to send calendar events to the application users without taking their consent ( O-Auth ). After reading Google's documentation, I found out that I need a service account. So I created a project and a service account from one of the email addresses of our G-Suite, noreply@xxxxx.com and enabled calendar API for the same. I created and downloaded a key pair (