首页 文章

谷歌终点JWT有限公司JWT声称传递通过

提问于
浏览
0

有没有办法要求特定的JWT声明显示在Google Cloud Endpoints oauth场景的“X-Endpoint-API-UserInfo” Headers 中?

作为背景,我已经成功地让Google Cloud Endpoints从Azure Oauth验证我的JWT令牌,但是Google Cloud Endpoints在 Headers 中传递的数据是有限的,并且没有充分包含来自原始声明的足够信息 .

Azure提供的声明可在此处找到:https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code .

例如

{ "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": "frank@contoso.com", "unique_name": "frank@contoso.com", "sub": "JWvYdCWPhhlpS1Zsf7yYUxShUwtUm5yzPmw_-jX3fHY", "family_name": "Miller", "given_name": "Frank" }.

但是,Google Cloud Endpoints仅返回此处指定的3个字段(颁发者,ID和电子邮件):https://cloud.google.com/endpoints/docs/openapi/authenticating-users .

正如您所看到的,字段中存在错位,也许某些字段对于在 endpoints 中访问是有 Value 的 .

1 回答

  • 0

    此时, X-Endpoint-API-UserInfo 将不包含来自声明的任何其他信息(即发行者,ID和电子邮件),但是,原始JWT令牌本身是传递的,因此您仍然可以从中提取其他声明表单 .

相关问题