0

所以我有一个应用程序女巫使用云端点来连接应用程序引擎后端。它在物理设备和安迪模拟器上完美运行。

然而,当我尝试在 arc 上进行身份验证时,我在 javascript 控制台中收到以下错误

Authentication error Error: Invalid OAuth2 scopes

使用以下堆栈

"Error: Invalid OAuth2 scopes.
at Error (native)
at Object.callback (chrome-extension://kanlgeedkacgohmccakppmlicnfgfpnl/_modules/mfaihdlpglflfgpfjcifdjdjcckigekc/gen_index.min.js:36:159)
at safeCallbackApply (extensions::sendRequest:21:15)
at handleResponse (extensions::sendRequest:73:7)"

auth.js:94 上发生错误,女巫看起来像这样

/** @private */
AuthManager.prototype.handleGetAuthToken_ = function(message) {
console.log('Authentication requested', message);

var reply = (function(data) {
var responseMessage = {
  namespace: 'androidIdentity',
  command: 'getAuthTokenResponse',
  data: data
};
  this.plugin_.postMessage(responseMessage);
}).bind(this);

var options = { 'interactive': true };
var scopes = this.parseScope_(message.data.tokenType);
if (scopes.length > 0) {
options.scopes = scopes;
}

// This call will pop up a window to ask user for permission to grant
// permissions of the given OAuth2 scopes, or declared scopes in
// manifest.json as a fallback.
//
// For non-signed-in Chrome session, this will open up a window to ask the
// user to sign in to Chrome first.
PromiseWrap.getAuthToken(options).then(function(token) {
  console.log('Authentication successful');
   reply({token: token});
   }, function(error) {
     console.error('Authentication error', error); // line 94 is here :(
     reply({error: error.message});
   });
};

我按照以下步骤操作:

1- download zip from arc welder
2- upload to chrome webstore
3- get id + "crx_key" from chrome webstore
4- get chrome key from developer console associated with application
5- launch arc welder and add oauth key 
6- add metadata "usePlayServices": ["gcm", "plus","location", "maps"],"crx_key":"<KEY FROM WEBSTORE>"
7- launch app - chose google account - get an oauth exception

我无法获取 logcat 数据,它的打印速度非常快以至于无法连接,哦,我正在 mac 上这样做。

编辑

似乎端点正在使用已弃用的范围

    https://www.googleapis.com/auth/userinfo.email
4

1 回答 1

1

[编辑]

ARC 尚不支持跨客户端身份验证。如果应用程序为“oauth2:server:client_id:9414861317621.apps.googleusercontent.com:api_scope:resource-1 resource-2”之类的范围请求身份验证令牌,它还不能工作。这是一个相关的跟踪错误

[原来的]

您是否在 Google Developers Console 上启用了“Google+ API”?

顺便说一句,如果您没有创建 Chrome 应用程序客户端,那么您应该在与您的 Android 应用程序相同的项目下创建该客户端。这样,您无需再次打开 API。

于 2015-04-10T18:13:49.487 回答