Request had invalid authentication credentials. Expected OAuth 2 access token error in cloud speech api

后端 未结 4 1033
野趣味
野趣味 2020-12-30 00:32

i have followed the google cloud speech api quickstart of requesting api by using

curl -s -H \"Content-Type: application/json\" \\
     -H \"Authorization: B         


        
相关标签:
4条回答
  • 2020-12-30 00:56

    Replace $(gcloud auth application-default print-access-token) with what gets printed when you call the command.

    0 讨论(0)
  • 2020-12-30 01:00

    I fixed the problem by logging out, and logging in to agree to some new terms and conditions google have made since last time I used google clouds (firebase in my case).

    0 讨论(0)
  • 2020-12-30 01:01

    It could be that The Application Default Credentials are not available

    Try to login by running

    gcloud auth application-default login
    

    And follow the instructions, reference: gcloud auth application-default login

    If you want to make sure the authentication process went well, run:

    gcloud auth application-default print-access-token
    

    You should see an access token, reference gcloud auth application-default print-access-token

    0 讨论(0)
  • 2020-12-30 01:03

    Samir's solution worked for me.

    Just a reminder that if using other software interacting with GCP, you may have to restart software before the auth takes effect.

    In my case, when using RStudio, I ran gcloud auth application-default login to authenticate, then command + shift + f10 to restart the R session, and then everything was good to go

    0 讨论(0)
提交回复
热议问题