[英]Google Cloud Endpoint Authentication from my Android Client: Audience not Allowed and Oauth framework user didn't match oauth token user
I'm trying to access a deployed appengine backend api using OAuth2.0 support from my android client. 我正在尝试从Android客户端使用OAuth2.0支持访问已部署的Appengine后端api。
Authentication is working fine from the api explorer using the authorised email address 使用授权的电子邮件地址通过api资源管理器进行身份验证正常
On the android side, I'm using the credentials/account picker method described here: https://developers.google.com/appengine/docs/python/endpoints/consume_android 在android方面,我使用的是此处所述的凭据/帐户选择器方法: https : //developers.google.com/appengine/docs/python/endpoints/consume_android
But I get a 403 status code saying the access is forbidden and the following in the appengine log when accessing from an android client: 但是我收到403状态代码,表示从Android客户端访问时禁止访问,并且在appengine日志中显示以下内容:
D 12:52:53.042 Checking for id_token.
W 12:52:53.046 Audience not allowed: 901326459160-vnpoik6ebefbnhtagqns7r0qlkt31gdo.apps.googleusercontent.com
D 12:52:53.047 Checking for oauth token.
D 12:52:53.049 Oauth framework user didn't match oauth token user.
I 12:52:53.050 Access rejected from none user.
What is happeing because the web app client id has been included in the whitelist for client ids and also the android client id?.... 令人遗憾的是,因为Web应用程序客户端ID已包含在客户端ID以及android客户端ID的白名单中?...。
从该错误看来,您的应用程序正在传递不正确的用户令牌或后端API,这就是为什么它显示“ Oauth框架用户与Oauth令牌用户不匹配。我建议您检查在其中使用的clientID您在此页面上的“配置Android客户端以提供凭据”的代码,并查看客户端ID(Android)是否与开发者控制台中的相同
我想出了什么问题。...Web客户端电子邮件是作为端点Api方法中的访问者而不是Web客户端ID传递的
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.