ich folgende bin die Dokumentation here und es sagt:kann nicht Anwendung Standardanmeldeinformationen für die Authentifizierung
The simplest way for applications to authenticate to a Google Cloud Platform API service is by using Application Default Credentials (ADC). Services using ADC first search for credentials within a GOOGLE_APPLICATION_CREDENTIALS environment variable; Google Cloud recommends you set this environment variable to point to your service account key file (the .json file downloaded when you created a service account key, as explained in Set Up a Service Account.
Und es sagt diesen Befehl zu verwenden:
$ export GOOGLE_APPLICATION_CREDENTIALS=<path_to_service_account_file>
Im Google Shell, ich habe versuchte dies:
<INSERT_SOMETHING>"~$ $ export GOOGLE_APPLICATION_CREDENTIALS=</Users/grantespanet/Downloads/myfile.json>
Aber ich bekomme diesen Fehler : -bash: syntax error near unexpected token newline
Ich habe auch schon versucht, diese:
<INSERT_SOMETHING>:~$ $ export GOOGLE_APPLICATION_CREDENTIALS=/Users/grantespanet/Downloads/myfile.json
aber nichts passiert
Ich weiß, dass der Befehl an die richtigen Speicherort der Datei verweist. Wie kann ich die Standardanmeldeinformationen der Anwendung erfolgreich authentifizieren?
Führen Sie einen anderen Befehl als "export" aus? Erwarten Sie, dass der Export etwas unternimmt? – Fred
Ich bin mir nicht sicher, ehrlich gesagt, ich versuche nur, den Dokumenten zu folgen, um Übersetzungen mit der Google Translation API zu implementieren, aber ich habe 'gcloud auth application-default login' verwendet und das könnte mein Problem behoben haben. @Fred – grant