1
votes

I have a gRPC API running in Google Cloud. I'm using Google's Extensible Service Proxy to connect it to a Google Endpoints Service. Then I enabled transcoding in the ESP so that a REST API is offered as well as a gRPC one. One thing that is important in my API is that each request is user-authenticated. In normal gRPC I'm having the user token sent with the metadata of each request along with the API key.

My question is how does this work with the transcoded REST API. How can I get the user token sent with each request?

I see that the API key which is processed by the ESP get's added to the request URL as a parameter, but what about my custom metadata, how does that get through?

1

1 Answers

0
votes

I've figured it out. I just need to put the metadata in the request headers.

curl -H "authorization: Bearer token-goes-here" https:api.domain/path?key=api-key