Search code examples
google-oauthgoogle-cloud-platformservice-accounts

How to programmatically create Google service account credentials?


I have a desktop application which I want to create a new service account for each user of my application.

Is there any API for creating the service account users on the fly?

Scenario: For each user, I want to give service account, and give this service account the data that this user needs.

The point is that I want to give every user some specific data from Google Cloud, but I want the user to get it directly from Google. I cannot use the user account, because I am not sure he have google account.


Solution

  • You can use the Google Identity and Access Management (IAM) API to programatically create service accounts.

    However, creating a service account for each of your application's users is expensive and not scalable. Perhaps your service can have a single service account and then the service can control which of the resources that the user may access.