service-accounts

Google sheets API v4 Create sheet and invite users

一曲冷凌霜 提交于 2019-12-01 17:31:35
I am using a service account authentication to create a google sheet using the Google Sheets API. I want to create a spreadsheet and somehow allow my team to open it. $private_key = file_get_contents($rootDir . '/config/googleApiCredentials.p12'); $client_email = 'project-names@positive-water-134xxx.iam.gserviceaccount.com'; $scopes = implode(' ', ["https://www.googleapis.com/auth/drive"]); $credentials = new \Google_Auth_AssertionCredentials( $client_email, $scopes, $private_key ); // tried once with additional constructor params: // $privateKeyPassword = 'notasecret', // $assertionType =

google service account example returns “Error refreshing the OAuth2 token { “error” : “invalid_grant” }”

匆匆过客 提交于 2019-11-30 22:50:05
My goal is to make the simplest query on Google Fusion Tables on behalf of my web app users. For that, I created a service account on google console. Here is the code: // Creating a google client $client = new \Google_Client(); // setting the service acount credentials $serviceAccountName = 'XXXXX.apps.googleusercontent.com'; $scopes= array( 'https://www.googleapis.com/auth/fusiontables', 'https://www.googleapis.com/auth/fusiontables.readonly', ); $privateKey=file_get_contents('/path/to/privatekey.p12'); $privateKeyPassword='notasecret'; // the default one when generated in the console

Google Service Account Authentication with Json file

旧街凉风 提交于 2019-11-30 13:11:11
I have been following the Oauth2 Service account documentation on Googles website. I have also been picking apart Googles .net client libray trying to get this to work. I have reached the Computing the signature stage. The privacy key from Google looks like this -----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDcmuyQC8rwWdPQ\nmIdksgzSJbVWTU5MeUxy+HAap3yut9wR/L6KGMJ4FBYcsPmXN5gQAhErybavGoZG\nfS1X1/PCpPVpTCA4749K8gbvuZg1JEIAqMtmHiBBrJj5l8eiekQc8pd7Pq35H4wi\nJYXAJGwggPcttkLBRi0xZzd+jdwL1st+7zRt8nMao/xFibInBBvKwb/gP4mJxlQg\nnRdGO6zgMk+PLTcA5C

Google API Service Account Authorization Error

江枫思渺然 提交于 2019-11-30 12:18:42
问题 I am using the google-api-php-client client to connect to Google Drive using a Service Account. Most of the time it works, but every so often (say if I sit here an refresh the page over and over it's every 5th to 10th time), I receive a Google_Service_Exception with the message unauthorized_client: Client is unauthorized to retrieve access tokens using this method . The error only occurs if the $this->drive_service->files->listFiles() code is present. It does not occur if I use the Service

Google API Service Account Authorization Error

十年热恋 提交于 2019-11-30 02:28:31
I am using the google-api-php-client client to connect to Google Drive using a Service Account. Most of the time it works, but every so often (say if I sit here an refresh the page over and over it's every 5th to 10th time), I receive a Google_Service_Exception with the message unauthorized_client: Client is unauthorized to retrieve access tokens using this method . The error only occurs if the $this->drive_service->files->listFiles() code is present. It does not occur if I use the Service Account directly rather than using setSubject() to impersonate another user. $this->client = new Google

How to access domain users' calendar using service account in .net?

随声附和 提交于 2019-11-30 00:09:10
问题 I am using service account with key.p12 cert to access google calendar API. However, it cannot access any user's calendar in the domain. I did follow the steps to Delegating domain-wide authority to the service account https://developers.google.com/accounts/docs/OAuth2ServiceAccount It does not have code sample for .net. And it seems I only get ServiceAccountCredential in the google .net client library. Here is my code static void Main(string[] args) { string serviceAccountEmail = "xxxx

gcloud: The user does not have access to service account “default”

拈花ヽ惹草 提交于 2019-11-29 19:52:59
问题 I attempting to use an activated service account scoped to create and delete gcloud container clusters (k8s clusters), using the following commands: gcloud config configurations create my-svc-account \ --no-activate \ --project myProject gcloud auth activate-service-account my-svc-account@my-project.iam.gserviceaccount.com \ --key-file=/path/to/keyfile.json \ --configuration my-svc-account gcloud container clusters create a-new-cluster \ --configuration my-svc-account \ --project= my-project

How to get all files of all users using google drive API

匆匆过客 提交于 2019-11-29 15:12:13
I am a 'domain admin' for a google account and would like to: Get all of the users in my domain and "for each" user, give another user read-access everyone's files . I can get each user, but right now I do not understand how to get each users documents. #!/usr/bin/python import gdata.docs import gdata.docs.service from gdata.apps import client userNameAtGmailCom = 'domainAdmin@someplace.com' password = 'mypassword' personToShareWith = "someGuy@gmail.com" domain = 'someplace.com' def login(userNameAtGmailCom, password, personToShareWith, domain): client = gdata.apps.client.AppsClient(domain

Google Drive Service Accounts Additional Storage

人盡茶涼 提交于 2019-11-28 14:31:36
I have an app where the users of my app can upload/download files, I don't want them to authorize every time they want to upload a file. So I came to know that Service Account is the solution to it, and that is exactly what I was looking for. I followed the the instructions given in this page: https://developers.google.com/drive/service-accounts It all works good, but the problem is the limit, i.e only 5GB, Isn't there any way where I can buy some Additonal Storage for my service Account(It is mentioned that It cannot be done, but still I just want to confirm). I do not want to use the web

Youtube Analytics & Google Service Account

六眼飞鱼酱① 提交于 2019-11-28 10:42:18
问题 Objectives: Implement a program (java or python) to retrieve data from videos that I published on my Youtube channel. This program will be launched daily (1:00 AM). Solutions: To retrieve data Youtube, including the number of views per day, YouTube Analytics API is in my opinion the best solution. I use the Google Account Service ("GoogleCredential") to authenticate me: static { // Build service account credential. try { // Create a listener for automatic refresh OAuthAccessToken List