简体   繁体   English

我的Android客户端中的Google Cloud Endpoint身份验证:不允许受众,并且Oauth框架用户与oauth令牌用户不匹配

[英]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.

相关问题 来自android的云端点身份验证:Oauth框架用户与oauth令牌用户不匹配 - Cloud endpoints authentication from android: Oauth framework user didn't match oauth token user Google Cloud Endpoints OAuth身份验证 - Google Cloud Endpoints OAuth Authentication oauth2:注销当前登录的google用户,然后从我的应用发送oauth网址 - oauth2: Logoff currently logged in google user and then send the oauth url from my app 在GAE客户端上使用OAuth 2.0(身份验证)令牌 - Using OAuth 2.0 (Authentication) token on GAE client 在Android上的我的应用之间共享oauth令牌-共享的用户ID,钥匙串,AccountManager或其他? - Sharing oauth token between my apps on Android - Shared User ID, Keychain, AccountManager or something else? Android OAUTH:刷新我的令牌 - Android OAUTH: Refreshing my token Google Api和android Oauth INVALID_AUDIENCE错误 - Google Api and android Oauth INVALID_AUDIENCE error Google API OAuth用户信息 - Google API OAuth User info 从Android客户端获取django OAuth2 Toolkit访问令牌 - Get django OAuth2 Toolkit access token from android client 我应该验证Android客户端中的OAuth2令牌,还是App Engine本身会根据传递给后端API的凭据对用户进行身份验证? - Should I verify the OAuth2 token in the Android client or will App Engine itself authenticate user based on the credential passed to the backend API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM