There are several types of application default credentials (ADC): User Account and Service Account and variations of those. The warning message in your question means that you set up the SDK CLI with user account credentials (gcloud auth login
). I recommend switching to service account credentials.
This command will setup the CLI with a service account. You will need your Project ID and service account JSON file.
gcloud auth activate-service-account test@PROJECT_ID.iam.gserviceaccount.com --key-file=service_account.json
I wrote an article that goes into detail on how to set up the CLI:
Setting up Gcloud with Service Account Credentials
Why is Google giving you a warning:
- Authorizing User Credentials requires more effort on Google's backend services.
- User Account credentials require human interaction to create.
- The Refresh Token is often stored by software on the client or backends. This creates a security hole.
- Software should use machine-to-machine authentication with limited permissions (scopes). User credentials typically are issued with too many permissions for the API calls being made. This again is a security issue.
- Google has decided that User Credentials will not be allowed to have the scopes required to access many Google Cloud Platform services. This is very apparent when creating OAuth Clients and you receive a big warning about verification. There is a strong risk that Google will stop allowing user credentials for cloud services. It is better to use the supported and official method of a service account and not face this issue in the future.
However, given the above details, your use case is providing your users with credentials. This is not a good idea. I would continue to use User Credentials talking to your web frontend. Your web frontend uses a service account that the user never sees and provides the final service (API) access.
[UPDATE]
I just noticed your comment that you are developing your own CLI. Without more details on what projects/services this CLI will be accessing you might consider using user credentials that talk to your service which issues an Access Token to the user. This token is only valid for one hour. You can support refreshing this token in your code. This gives you the ability to use user authentication, control service account usage and still maintain good security. Notice that I am trying to steer you away from distributing service account files directly to users. If these users are your own employees, this is less of a problem. For people not under your control think carefully.
[END UPDATE]
I will try to provide details and advice on your questions. Do consider my previous comments while deciding the best strategy for you.
In the other case, (service account specific credentials) I assume I
will have to provide instructions to each developer to issue a json
file that corresponds to a service account with the exact same
permission as his/hers.
If I were to write an application that used service account credentials, I would create a method to load/install the credentials. Just provide a file and tell them to do this step in the program. However, you have an issue. It is not a good idea to distribute the same service account to all users. How do you handle revoking, etc? Google Cloud Platform service accounts are not designed to be distributed uniquely to more than a few dozen or hundreds users per project.
And what about the update process?
Service account credential JSON key files do not expire. The tokens created from the service account do expire but this is managed by Google client libraries or in your own code to automatically refresh them.
What happens each time a user gets assigned/revoked some permissions?
How this JSON stay in sync?
The service account file does not contain permissions. These are stored in Google Cloud IAM. Once you modify the roles assigned to a service account, they are transparently applied globally within a few minutes.