0
votes

Is there a way to request specific JWT Claims to show up in the "X-Endpoint-API-UserInfo" header in a Google Cloud Endpoints oauth scenario?

As background, I have successfully had Google Cloud Endpoints validate my JWT token from Azure Oauth, however the data passed through in the header by Google Cloud Endpoints is limited and does not adequately contain enough information from the original Claims.

The claims provided by Azure can be found here: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code.

For example

{ "aud": "2d4d11a2-f814-46a7-890a-274a72a7309e", "iss": "https://sts.windows.net/7fe81447-da57-4385-becb-6de57f21477e/", "iat": 1388440863, "nbf": 1388440863, "exp": 1388444763, "ver": "1.0", "tid": "7fe81447-da57-4385-becb-6de57f21477e", "oid": "68389ae2-62fa-4b18-91fe-53dd109d74f5", "upn": "[email protected]", "unique_name": "[email protected]", "sub": "JWvYdCWPhhlpS1Zsf7yYUxShUwtUm5yzPmw_-jX3fHY", "family_name": "Miller", "given_name": "Frank" }.

However, Google Cloud Endpoints only returns 3 fields (issuer, id, and email) as specified here: https://cloud.google.com/endpoints/docs/openapi/authenticating-users.

As you can see, there is misalignment in the fields, and perhaps some fields that would be valuable to have access to in the endpoints.

1

1 Answers

0
votes

At this moment, X-Endpoint-API-UserInfo won't contain any additional info from claims than those documented (i.e. issuer, id, and email), however, the original JWT token itself is passed-through, so you can still extract the additional claims form there.