You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@puneith The point (I think) was that by moving the sample away from the API key feature, we could more easily remove support for that feature in this library in future versions.
I have recently started having problems making simple api-key translation calls. It works ok with one virtualenv, but running in a different virtualenv, and/or different project causes this error:
It looks like it's trying to use the project cloudsdktool rather than the one I have setup using gcloud. Any idea how to fix this? It used to work so easily!!
@geoffwalmsley this is a quirk of how default credentials works. In your case the credentials are being supplied by the Cloud SDK. Unfortunately, these credentials are not sufficient for using the translate API. You'll need to download a service account key and use that.
@jonparrott Are you still opposed to removing support for API key? You were concerned that it was needed for Python clients which can't store secrets, though the API key is itself a secret.
Activity
tseaver commentedon Nov 15, 2016
/cc @jonparrott for confirmation that we can safely remove it (per today's discussion).
theacodes commentedon Nov 15, 2016
@puneith our sample over at python-docs-samples still uses an API Key. Can we switch the sample over to service account credentials?
puneith commentedon Nov 15, 2016
This still uses API_KEY https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/translate/google/cloud/translate/client.py
dhermes commentedon Nov 15, 2016
@puneith The point (I think) was that by moving the sample away from the API key feature, we could more easily remove support for that feature in this library in future versions.
puneith commentedon Nov 15, 2016
Got it. I will make the appropriate changes.
geoffwalmsley commentedon Nov 28, 2016
I have recently started having problems making simple api-key translation calls. It works ok with one virtualenv, but running in a different virtualenv, and/or different project causes this error:
google.cloud.exceptions.Forbidden: 403 Google Translate API has not been used in project google.com:cloudsdktool before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/translate.googleapis.com/overview?project=google.com:cloudsdktool then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry. (GET https://translation.googleapis.com/language/translate/v2?target=en&q=mein&source=de)
It looks like it's trying to use the project cloudsdktool rather than the one I have setup using gcloud. Any idea how to fix this? It used to work so easily!!
daspecster commentedon Nov 28, 2016
@geoffwalmsley are you setting the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable?Otherwise you should be able to set the project when creating the
Client(project='my-project').theacodes commentedon Nov 28, 2016
@geoffwalmsley this is a quirk of how default credentials works. In your case the credentials are being supplied by the Cloud SDK. Unfortunately, these credentials are not sufficient for using the translate API. You'll need to download a service account key and use that.
dhermes commentedon Dec 2, 2016
@jonparrott Are you still opposed to removing support for API key? You were concerned that it was needed for Python clients which can't store secrets, though the API key is itself a secret.
theacodes commentedon Dec 2, 2016
I'm not opposed to removing it.
Removing support for API_KEY auth in translate.
Removing support for API_KEY auth in translate.
chore: move samples from python-docs-sample (#66)
Removing support for API_KEY auth in translate.