简体   繁体   中英

The caller does not have permission. 403

I need your help to understand how I can access my Cloud Storage.I use Unity, and read the documentation (I confess, not all).I do not have problems with upload the file to storage. I save audio files there, for recognition with Google Cloud Speech Api, using the HTTP request on this: https://speech.googleapis.com/v1/speech:longrunningrecognize?key= + MySpeechApiKey

I am trying to send this:

"{"config": {"encoding":"LINEAR16","sampleRateHertz":44100,"languageCode":"ru-RU","maxAlternatives":1,"profanityFilter":false,"speechContexts":[{"phrases":[""]}],"enableWordTimeOffsets":false},

"audio":{"uri":"gs://calm-vine-195513.appspot.com/2018.7.28_10_1_16_382.flac"}}

And i get request:

{

    "error": {

        "code": 403,

        "message": "The caller does not have permission",

        "status": "PERMISSION_DENIED"

    }

}

It is worth considering that in the Firebase I made a rule:

service firebase.storage {

    match /b/{bucket}/o {

        match /{allPaths=**} {

            allow read, write;

        }

    }

}

I found a couple of tips that say that I need some kind of service account. How can i do that?Do I need in request URI to add some key or what?

I had the same problem and solved it the following way:

1) You must have gcloud and gsutil installed

2) Then run gcloud init in command prompt. Here you must configure the configuration

3) Run gsutil iam ch allUsers:objectViewer gs:// your_bucket

It worked for me =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM