尝试在 Chrome 上创建 Google AccountCredential 和 ARC-Welder 时使用 Goo



我有一个Android应用程序,我正在尝试在Chrome ARC(通过ARC-Welder)下运行。 我已经创建了所有的OAuth2 ID,并更改了我的APK,以替换Chrome客户端ID(如果它在ARC下运行(build=="chromium")。 但是,我仍然收到GoogleAuthUtil.getToken()的"INVALID_SCOPE"例外。

实际的"范围"值为:

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 "端点",还是根本不支持?

ARC 不支持跨客户端身份验证(只是尚不支持)。 这是一个用于跟踪的相关错误。

最新更新