1

我已经保护了 Cloud IAP 背后的 Google App Engine 应用程序 - 端点现在需要按预期通过浏览器进行 Google 登录,并且一旦我添加了正确的权限就可以正常工作。但是,当我尝试使用 Postman / MS PowerApps OAuth2 身份验证时,出现以下错误:Expected JWT to have 3 parts by a '.' 但有 2 个部分。

这是我的邮递员设置:

Grant Type: Authorization Code

Callback URL: Authed Callback URL (added to list in console)

Auth URL: https://accounts.google.com/o/oauth2/auth

Access Token URL: https://accounts.google.com/o/oauth2/token

Client ID: IAP-App-Engine-app ClientID

Client Secret:  IAP-App-Engine-app Client Secret

Scope: openid email

Client Authentication: Send as Basic Auth Header

Cloud IAP OAuth2 有解决方案吗?

谢谢,

4

2 回答 2

1

Google Cloud IAP 需要 OAuth 身份令牌。您正在尝试使用 OAuth 访问令牌。

于 2019-10-02T13:37:54.277 回答
0

我通过 Identity Platform 的文档搜索找到了答案。

https://cloud.google.com/iap/docs/identity-howto

IAP 还会在以下 HTTP 标头中将用户的身份传递给您的后端服务。这些标头应具有命名空间前缀 accounts.google.com。

如果将 Header Prefix 从默认更改Beareraccounts.google.com请求令牌时,则后续对 IAP 安全资源的调用将成功。

于 2020-10-20T16:05:04.100 回答