Your application has authenticated using end user credentials from the Google Cloud SDK which are not supported by the translate.googleapis.com
This error message is caused by using User Credentials when you setup the Cloud SDK. Typically this is done using the command gcloud auth login
.
There are several methods to solve this problem. Each method uses a Service Account.
Method 1:
Create a service account and set up the Cloud SDK to use the service account.
Example command:
gcloud auth activate-service-account [email protected] --key-file=/fullpath/service-account.json
Method 2:
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to point to your service account JSON file.
set GOOGLE_APPLICATION_CREDENTIALS=/fullpath/service-account.json
Method 3:
Specify the service account when creating your Java SDK clients.
This link shows examples of specifying a service account file:
Setting Up Authentication for Server to Server Production Applications