Skip to content

Audiences not being passed as part of claims (when more than 1 present as a list) #743

@maroux

Description

@maroux
  1. Deploy to app engine flex with following config in app.yaml:
endpoints_api_service:
  name: hello.example.com
  rollout_strategy: managed
  1. Deploy service config as such:
host: hello.example.com
securityDefinitions:
  auth0_jwk:
    authorizationUrl: ''
    flow: implicit
    type: oauth2
    x-google-issuer: https://<TENANT>.auth0.com/
    x-google-jwks_uri: https://<TENANT>.auth0.com/.well-known/jwks.json
    x-google-audiences: https://hello.example.com
x-google-endpoints:
- name: hello.example.com
  allowCors: true
security:
- auth0_jwk: []
  1. Hit the app engine endpoint with a token that looks like this:
{
  "header": {...},
  "payload": {
    "iss": "https://<TENANT>.auth0.com/",
    "sub": "<ID>",
    "aud": [
      "https://hello.example.com",
      "https://<TENANT>.auth0.com/userinfo"
    ],
    "iat": <>,
    "exp": <>,
    "azp": <>,
    "scope": "openid email",
    "permissions": []
  },
  "signature": <>
}
  1. Look at X-Endpoint-API-UserInfo header received by the app engine app:
{
    "claims": "{\"iss\":\"https://<TENANT>.auth0.com/\",\"sub\":\"<ID>\",\"aud\":\"\",\"iat\":<>\"exp\":<>,\"azp\":\"<>\",\"scope\":\"openid email\",\"permissions\":[]}","issuer":"https://<TENANT>.auth0.com/","id":"<ID>"}

Bug: aud is empty here
Expected: aud = https://hello.example.com

The same workflow when deployed using Cloud Run (except x-google-backend is included in service swagger yaml), creates a user info header that includes the audience field correctly.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions