Ham*_*son 5 google-app-engine google-iap
我正在尝试为托管在Google云中的应用程序设置云IAP。
通过Web登录该应用程序效果很好,您将重定向到Google身份验证页面,并重定向回网站,并将会话令牌设置为cookie。
通过非Web界面进行身份验证,请遵循编程身份验证指南,尝试在那里描述的命令行方式以及使用iOS SDK。在这两种情况下,登录都可以正常工作,并且我从登录过程中收到一个id_token。但是当我发出如下请求时:
curl --verbose --header 'Authorization: Bearer ID_TOKEN' https://an-app.appspot.com/api/user
Run Code Online (Sandbox Code Playgroud)
我总是收到以下回复:
There was a problem with your request. Error code 13
Run Code Online (Sandbox Code Playgroud)
不管请求中的ID_TOKEN是什么,响应始终是错误代码13。如果我未指定Authorization标头,则会将我重定向到Google的登录页面。
我缺少任何设置或配置吗?
太长了;
问题是身份验证有效负载的错误配置,就我而言,目标受众不正确。这是适当的格式:
// this is the IAP client ID that can be obtained by clicking 3 dots -> Edit OAuth Client in IAP configuration page
const target_audience = "12345.apps.googleusercontent.com";
Run Code Online (Sandbox Code Playgroud)
细节
我遇到了同样的问题,我使用这篇文章的混合解决了这个问题:如何验证谷歌云功能以访问安全的应用程序引擎端点和这个要点: https: //gist.github.com/plmrrry/f78136bba68f810622bc2840497ef7e1
归档时间: |
|
查看次数: |
2103 次 |
最近记录: |