我有一个Android应用程序,我试图在Chrome ARC下运行(通过ARC-Welder)。我已创建了所有OAuth2 ID并更改了我的APK以替换Chrome客户端ID(如果它在ARC下运行(build ==" chromium"))。但是,我仍然得到" INVALID_SCOPE"来自GoogleAuthUtil.getToken()
的例外情况。
实际"范围"价值是:
audience:oauth2:client_id:numbers-numbersandletters.apps.googleusercontent.com
来自logcat
的实际异常是:
com.google.android.gms.auth.GoogleAuthException: INVALID_SCOPE
at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
at com.google.android.gms.auth.GoogleAuthUtil.getToken(Unknown Source)
at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.getToken(GoogleAccountCredential.java:255)
...
发出此请求的代码是:
final String clientid = isChromeArc() ? CHROME_CLIENT_ID : WEB_CLIENT_ID;
googleCredential = GoogleAccountCredential.usingAudience(this, "server:client_id:" + clientid);
final String accountname = settingsPreferences.getString(PREF_ACCOUNT_NAME, null);
googleCredential.setSelectedAccountName(accountname);
assert googleCredential.getSelectedAccount() != null;
assert !googleCredential.getSelectedAccount().equals("");
if (googleCredential.getToken() == null) ... // <== exception here
最后,在创建过程中给ARC-Welder的元数据是:
{
"usePlayServices": ["maps"],
"crx_key": "MII...verylongbase64string...AB"
}
我需要做些什么不同才能连接到我的App-Engine&#34;端点&#34;或者这还不支持?