service-accounts

How to use auth token in Google API (Ruby) WebmastersV3 (service account access)

拈花ヽ惹草 提交于 2020-06-29 03:59:30
问题 I cannot connect the two pieces together: I am able to authenticate my service account and I know how to form the request for the information I need to retrieve from the API, but I cannot figure out how to make that request authenticated with the token. This builds an object from the credential file I got for the service account and generates token successfully: require 'googleauth' require 'google/apis/webmasters_v3' website = "https://example.com" scope = 'https://www.googleapis.com/auth

Login to firebase using gcloud service account

谁都会走 提交于 2020-06-27 18:49:57
问题 I have functions deployed to gcloud functions and i want to configure CI/CD for deploying this functions from gitlab. To do any operations from gitlab i need to get firebase auth token with firebase login:ci command. The problem is that i need to get this token using gcloud service account, which is not displayed in browser, when i run firebase login:ci I have this service account data ( project_id , private_key , private_key_id , etc.) How should i authorize using this acc? 回答1: If you set

How to use the scope https://www.googleapis.com/auth/drive.file correctly

吃可爱长大的小学妹 提交于 2020-06-27 08:47:11
问题 I have tried accessing a Google Sheets file in my Google Drive with this code: import gspread from oauth2client.service_account import ServiceAccountCredentials scope = ['https://www.googleapis.com/auth/drive'] credentials = ServiceAccountCredentials.from_json_keyfile_name('credentials.json', scope) gc = gspread.authorize(credentials) wks = gc.open('my_test').sheet1 print(wks.get_all_records()) I have then created a spreadsheet called my_test in my drive and shared it with the email in

Google Calendar API Service Account Error 401 Invalid credential

≯℡__Kan透↙ 提交于 2020-05-31 03:44:09
问题 I'm trying to create a Google Calendar Service Account. Here are my credentials: Here's my service account definition (Site Wide delegation for service account is enabled): Here's my "Manage API client access" page: And this is my code: string userName = "xxx@yyy.it"; string[] Scopes = { CalendarService.Scope.Calendar, CalendarService.Scope.CalendarEvents }; string ApplicationName = "Client per quickstart"; ServiceAccountCredential credential = GoogleCredential.FromFile(@"path\credentialjson

Google Calendar API Service Account Error 401 Invalid credential

前提是你 提交于 2020-05-31 03:42:31
问题 I'm trying to create a Google Calendar Service Account. Here are my credentials: Here's my service account definition (Site Wide delegation for service account is enabled): Here's my "Manage API client access" page: And this is my code: string userName = "xxx@yyy.it"; string[] Scopes = { CalendarService.Scope.Calendar, CalendarService.Scope.CalendarEvents }; string ApplicationName = "Client per quickstart"; ServiceAccountCredential credential = GoogleCredential.FromFile(@"path\credentialjson

Google Calendar API Service Account Error 401 Invalid credential

回眸只為那壹抹淺笑 提交于 2020-05-31 03:41:17
问题 I'm trying to create a Google Calendar Service Account. Here are my credentials: Here's my service account definition (Site Wide delegation for service account is enabled): Here's my "Manage API client access" page: And this is my code: string userName = "xxx@yyy.it"; string[] Scopes = { CalendarService.Scope.Calendar, CalendarService.Scope.CalendarEvents }; string ApplicationName = "Client per quickstart"; ServiceAccountCredential credential = GoogleCredential.FromFile(@"path\credentialjson

Upload and get Download URL of Google Drive in Java - Service Account [closed]

浪尽此生 提交于 2020-05-17 06:02:06
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 days ago . I am using Google Drive API in my android app. I will use a service account as credentials. Task is to upload image on Drive and immediately get its Download URL. (I will be saving URL in firebase database) I also want to fetch the image by using same URL later. I have followed this answer How to

How can I authorize Google Speech-to-text from Google Apps script?

折月煮酒 提交于 2020-05-14 08:48:09
问题 I'm trying to execute google-speech-to-text from apps script. Unfortunately, I cannot find any examples for apps script or pure HTTP, so I can run it using simple UrlFetchApp. I created a service account and setup a project with enabled speech-to-text api, and was able to successfully run recognition using command-line example curl -s -H "Content-Type: application/json" \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ https://speech.googleapis.com/v1/speech

How can I authorize Google Speech-to-text from Google Apps script?

早过忘川 提交于 2020-05-14 08:47:32
问题 I'm trying to execute google-speech-to-text from apps script. Unfortunately, I cannot find any examples for apps script or pure HTTP, so I can run it using simple UrlFetchApp. I created a service account and setup a project with enabled speech-to-text api, and was able to successfully run recognition using command-line example curl -s -H "Content-Type: application/json" \ -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \ https://speech.googleapis.com/v1/speech

Is it possible to call APIs from service account without acting on behalf of a user in domain-wide delegation?

我的梦境 提交于 2020-05-11 11:58:54
问题 My Python script retrieves infos about users and groups from a G Suite (testing, for now, with the 14 days free account). I'm using domain-wide delegation and OAuth 2.0 for server to server applications because I don't want to display a pop window where users from hosted domains would allow me to see their groups and users. These are the steps I followed in order to get users and groups: create and download all the necessary credentials, such as Client ID; from my G Suite admin console, allow