service-accounts

Unable to query Google Search Console API using a Service Account

霸气de小男生 提交于 2020-08-24 03:45:38
问题 I need to retrieve some data from Google Search Console (Webmaster Tools) using a service account. So far I've been able to retrieve an access_token for the service account which I need to append to the url of the request. The problem is that I can't find a way to do so, this is the code i'm using: function retrieveSearchesByQuery(token) { gapi.client.webmasters.searchanalytics.query( { 'access_token': token, 'siteUrl': 'http://www.WEBSITE.com', 'fields': 'responseAggregationType,rows',

How to limit access to google app engine flask endpoints to just application code (or app engine service accounts)

非 Y 不嫁゛ 提交于 2020-08-10 23:06:06
问题 Currently building an app on app engine standard environment, with python 3.7 and the flask framework. I need to schedule some tasks which will require the app to run several sensitive endpoints periodically. I want to limit access to these endpoints to the application itself, preventing (non-admin) users from accessing these. In the Python 2 version of app engine, it is possible by specifying login: admin in the app.yaml file like so: # app.yaml for google app engine standard env python 2

Insert event in google calendar using service account with Nodejs

偶尔善良 提交于 2020-08-09 08:13:18
问题 I can't insert an event using Nodejs with service account. The service account Email is already added into the account with the permission make changes to event My nodejs code is running on google cloud functions Here is my code: const { google } = require('googleapis'); var event = { 'summary': 'Google I/O 2015', 'location': '800 Howard St., San Francisco, CA 94103', 'description': 'A chance to hear more about Google\'s developer products.', 'start': { 'dateTime': '2020-02-10T13:00:00-05:00'

Using standalone 'gsutil' from within GKE

扶醉桌前 提交于 2020-08-07 08:40:47
问题 I'm trying to use the standalone gsutil tool from within a container running in a GKE cluster, but I cannot get it to work. I believe the cluster has adequate permissions (see below). However, running ./gsutil ls gs://my-bucket/ yields ServiceException: 401 Anonymous users does not have storage.objects.list access to bucket my-bucket. Am I missing anything? I don't have a .boto file, as I believe it shouldn't be necessary—or is it? This is the list of scopes that the cluster and the node pool

Using standalone 'gsutil' from within GKE

安稳与你 提交于 2020-08-07 08:39:07
问题 I'm trying to use the standalone gsutil tool from within a container running in a GKE cluster, but I cannot get it to work. I believe the cluster has adequate permissions (see below). However, running ./gsutil ls gs://my-bucket/ yields ServiceException: 401 Anonymous users does not have storage.objects.list access to bucket my-bucket. Am I missing anything? I don't have a .boto file, as I believe it shouldn't be necessary—or is it? This is the list of scopes that the cluster and the node pool

Google OAuth using domain wide delegation and service account

那年仲夏 提交于 2020-07-23 07:11:28
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

Google OAuth using domain wide delegation and service account

大兔子大兔子 提交于 2020-07-23 07:10:49
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

Google OAuth using domain wide delegation and service account

谁都会走 提交于 2020-07-23 07:09:38
问题 I am trying to make google drive API calls using domain wide delegation by using a service account. I can get the authentication working but not the drive api calls. Error: File not found when creating a file in drive Also before domain wide delegation I made it to work by sharing a drive folder with the service account. But now I want it to work without sharing. I think i need to do some setServiceAccount stuff somewhere. Not sure where that would happen. const {google} = require('googleapis

Difference between “drive.metadata.readonly” and “drive.readonly.metadata”

↘锁芯ラ 提交于 2020-07-22 21:31:06
问题 I want to ask what is the difference between DriveScopes.DRIVE_METADATA_READONLY and https://www.googleapis.com/auth/drive.readonly.metadata ? In other words, what is the difference between these two forms: https://www.googleapis.com/auth/drive.metadata.readonly //DriveScopes.DRIVE_METADATA_READONLY https://www.googleapis.com/auth/drive.readonly.metadata When I was using service account for working with Drive API it takes me a long time to figure out, why my app was throwing unauthorized

gsuite service account for directory api returns http 400 errors: Bad request/Invalid input

百般思念 提交于 2020-07-19 06:42:18
问题 I have started to develop some apis to create users in my G suite directory. I followed the service account tutorials along with the Directory tutorials for python. The code I have is very simple just to test out how it will work. from google.oauth2 import service_account from googleapiclient.discovery import build SCOPES = ['https://www.googleapis.com/auth/admin.directory.user'] SERVICE_ACCOUNT_FILE = 'file' creds = service_account.Credentials.from_service_account_file( SERVICE_ACCOUNT_FILE,