grpc-swift: Cannot authenticate via API key
I just cannot get authentication to work using Google Cloud (Speech) API keys. I’ve checked every example there is, yet my key is always rejected. I set the API key on the service metadata
.
I’ve seen examples using…
X-Goog-Api-Key
: swift grpc says invalid header. Error:
invalidMetadata
E0524 08:35:15.361115000 6176894976 call.cc:935] validate_metadata: {"created":"@1527143715.360978000","description":"Illegal header key","file":"/Users/era/Desktop/SpeechTest/Pods/gRPC-Core/src/core/lib/surface/validate_metadata.cc","file_line":43,"offset":0,"raw_bytes":"58 2d 47 6f 6f 67 2d 41 70 69 2d 4b 65 79 'X-Goog-Api-Key'"}
Authorization
:Bearer + Token
, swift grpc says invalid header
invalidMetadata
E0524 08:36:53.669556000 6135263232 call.cc:935] validate_metadata: {"created":"@1527143813.669152000","description":"Illegal header key","file":"/Users/era/Desktop/SpeechTest/Pods/gRPC-Core/src/core/lib/surface/validate_metadata.cc","file_line":43,"offset":0,"raw_bytes":"41 75 74 68 6f 72 69 7a 61 74 69 6f 6e 'Authorization'"}
X-Api-Key
: seems to work as a header
successful, status permissionDenied: The request is missing a valid API key.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 37
You need to remove the
http://
.