GoogleCloudPlatform / GoogleCloudPlatform/esp-v2

Support AppEngine Flex in custom image mode based on ESPv2 image

Open
#171 14 comments 0 reactions 1 assignee Claimed by @qiwzhang View on GitHub
Dominant language
Go
Stars
307
Forks
185
Avg merge
14h 45m
Merged PRs (30d)
6

Description

Hi

I'm trying to deploy esp in the following configuration:

ESPv2 - `gcr.io/endpoints-release/endpoints-runtime-serverless:2.10.0` deployed to App Engine flex with env:
```
GOOGLE_APPLICATION_CREDENTIALS = ""
ENDPOINTS_SERVICE_NAME = "-dot-.appspot.com"
```

Endpoints config: Copy of [sample](https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/endpoints/getting-started/openapi-appengine.yaml) with these changes:
```
-host: "YOUR-PROJECT-ID.appspot.com"
+host: "-dot-.appspot.com"

- x-google-audiences: "YOUR-CLIENT-ID"
+ x-google-audiences: ""

+ auth0_jwk:
+ authorizationUrl: ""
+ flow: "implicit"
+ type: "oauth2"
+ x-google-issuer: "https://.auth0.com/"
+ x-google-jwks_uri: "https://.auth0.com/.well-known/jwks.json"
+ x-google-audiences: "https://-dot-.appspot.com/"
+
+x-google-backend:
+ address: "https://-dot-.appspot.com"
+ jwt_audience: ""
+ protocol: h2
+
+
+x-google-endpoints:
+ - name: -dot-.appspot.com
```

The app is fronted by IAP to restrict access only to the ESP user. However, the requests fail with this error:
```
HTTP/2 401
date: Sat, 30 May 2020 22:38:06 GMT
content-type: text/html; charset=UTF-8
content-length: 57
x-goog-iap-generated-response: true
x-envoy-upstream-service-time: 27
server: envoy
via: 1.1 google
alt-svc: h3-27=":443"; ma=2592000,h3-25=":443"; ma=2592000,h3-T050=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q049=":443"; ma=2592000,h3-Q048=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"

Invalid IAP credentials: JWT 'email' claim isn't a string
```

Upon debugging, I found the token that ESP sends its requests with looks like this:
```
{
"aud": "",
"azp": "103551354333791234484",
"exp": 1590879029,
"iat": 1590875429,
"iss": "https://accounts.google.com",
"sub": "103551354333791234484"
}
```

As seen here, `sub` isn't the email of the service account I specified in ESP configuration.

Please advise.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.