I'm setting up a pet project using Google Cloud Endpoints and Google Cloud Functions, with Google ID token authentication. I've followed this and this guides to set things up, however the X-Endpoint-API-UserInfo
header is not passed to the cloud function.
I've have one POST endpoint set up in this OpenAPI yaml. It's deployed to Cloud Endpoints, and also an Extensible Service Proxy. When I call this from Postman with a token generated with gcloud auth application-default print-access-token
, I find that the authentication does work, but only the following headers are present in the function: host, user-agent, transfer-encoding, accept, accept-encoding, authorization, cache-control, forwarded, function-execution-id, postman-token, x-appengine-city, x-appengine-citylatlong, x-appengine-country, x-appengine-default-version-hostname, x-appengine-https, x-appengine-region, x-appengine-request-log-id, x-appengine-user-ip, x-cloud-trace-context, x-forwarded-for, x-forwarded-proto, x-real-ip, connection
Can you help me why I don't get the user info from ESP in the function?
401 Unauthorized
with messageJWT validation failed: Bad JWT format: Invalid JSON in header
. I'm wondering if my way of generating access token is good. – esgott