Questions tagged [service-accounts]

The Google OAuth 2.0 endpoint supports server-to-server interactions such as those between a web application and Google Cloud Storage.

A service account is used when you want to access your own data and not data owned by other users. In this instance there is no reason to use OAuth2 and prompt a user to give you access to there information, its your information you already have access.

For this scenario you need a service account, which is an account that belongs to your application instead of to an individual end user. For example, if you use the Google Prediction API to act on behalf of your application without accessing any user data, your application uses its service-account credentials to prove its own identity, and no end user is involved.

A service account's credentials include a generated email address that is unique, a client ID, and at least one public/private key pair. You obtain these credentials in the Google Developers Console, or if your application uses Google App Engine, a service account is set up automatically. You use the client ID and one private key to create a signed JWT and construct an access-token request in the appropriate format.

1492 questions
8
votes
1 answer

Invoking Google Cloud Function from python using service account for authentication

I have a cloud function with trigger type set to HTTP and also have a service account which is having permissions to Invoke the cloud function. I want to invoke the cloud function from a python script. I am using the following script to invoke the…
8
votes
0 answers

Service Account is not appearing on the Google Play API Access

to test the Google Play Billing developers have requested me the Google Service Account. I did go to Google Play Console -> Account -> API and have already linked the "Google Play Android Developer" project there. Then I went to the link in the…
8
votes
1 answer

How to create a service account with Google Drive access

I am trying to create a service account in Google Cloud Platform that has Google Drive API access only. However, I cannot find the role at all: Furthermore, if I create a 'general service account', then that user can add instances, etc. This has…
David542
  • 104,438
  • 178
  • 489
  • 842
8
votes
2 answers

Unable to block room using Google calendar Api

This is my java code using this code I am trying to create event with room (room is added using resource Google Calendar API) event created success fully with room A. However when I check in Google Calendar and try see available room in that A…
8
votes
2 answers

Google API Service Account Authorization Error

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…
MarcGuay
  • 747
  • 9
  • 15
8
votes
3 answers

Authenticate to use Google Sheets with service account instead of personal account in C# .NET

I have an application that I developed that utilizes a few Google Sheets. I was able to figure out how to get it to have access to the Google Sheets API using the following code: UserCredential credential; using (var stream = …
Hanny
  • 580
  • 3
  • 16
  • 44
8
votes
4 answers

Access Google Calendar API using Service Account Authentication

I was able to access the Google Calendar API using the .NET Quickstart tutorial and it worked great! The problem with that tutorial is that it uses Open Authentication or OAuth2. I will like to do the same using Service Account Authentication.…
7
votes
1 answer

Cloud Functions / Cloud Tasks UNAUTHENTICATED error

I am trying to get a Cloud Function to create a Cloud Task that will invoke a Cloud Function. Easy. The flow and use case are very close to the official tutorial here. I also looked at this article by Doug Stevenson and in particular its security…
7
votes
1 answer

User does not have sufficient permissions for this property

I use sample code cd cloudshell_open/nodejs-analytics-data/samples/ node quickstart_json_credentials.js propertyId MY.json propertyId:This site generated MY.json:generated Response is error. 7 PERMISSION_DENIED: User does not have sufficient…
7
votes
1 answer

What is the difference between service account and service agent in GCP

Say I have this case where I have to run some test with dataflow inside this dataflow job I need to access a gcs bucket and save my output there. I will need to run the dataflow job with my own SA instead of the default SA. I created a Google…
Roger Ray
  • 1,251
  • 2
  • 12
  • 20
7
votes
1 answer

Send message to Google Chat using the REST API (Google example not working in 2020)

Where do I even begin... (Google, why must you hurt me this way?) Background Info I have created a new chatbot using Google Apps Script, which receives messages from users in Google Chat and responds synchronously with a single message (each message…
7
votes
2 answers

Docker - Error: Cannot perform an interactive login from a non TTY device (GCP Service Account)

The command docker login -u _json_key --password-stdin https://gcr.io < ~/service-account.json works locally, but when I try to run it in a CI environment like Github Actions, I get the following error. Error: Cannot perform an interactive login…
Clement
  • 4,491
  • 4
  • 39
  • 69
7
votes
0 answers

Use a service account to get the list of users from Google domain

Hello all. I have been assigned the task of fetching unanswered emails from the inbox of each member of our Google domain using Spring Boot, but I haven't been able to do it. In first place, I need the list of users from the domain. This can be…
7
votes
4 answers

Google Cloud Tasks cannot authenticate to Cloud Run

I am trying to invoke a Cloud Run service using Cloud Tasks as described in the docs here. I have a running Cloud Run service. If I make the service publicly accessible, it behaves as expected. I have created a cloud queue and I schedule the cloud…