所以我得到了一个使用云端点的应用程序,以便与app引擎后端连接。它完美地适用于物理设备和andy模拟器。
然而,当我尝试在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
答案 0 :(得分:1)
<强> [编辑] 强>
ARC尚不支持Cross client authentication。如果应用程序请求范围内的auth令牌,例如“oauth2:server:client_id:9414861317621.apps.googleusercontent.com:api_scope:resource-1 resource-2”,它将无法正常工作。以下是跟踪的相关bug。
<强> [原始] 强>
您是否在Google Developers Console上启用了“Google+ API”?
顺便说一下,如果不这样做,您应该在与Android应用相同的项目下创建Chrome应用客户端。这样,您就不需要再次打开API了。