我正在使用 QR 码以完全托管模式在 Android 8.1.0 上设置 Android Management API。
我正在按照谷歌代码实验室链接来配置一个完全托管的设备,使用我的帐户进行身份验证,然后它就可以工作了。
但是,当我使用服务帐户进行身份验证时,按照示例代码生成 QR 码然后它不起作用:
- 策略不同步。
- enterprise.devices.list 返回空列表。
但是,如果我使用它来设置工作配置文件模式,那么它就可以工作。
服务帐号在 Google Cloud 项目中具有 Owner 角色。
这是二维码内容:
// Authenticate with a Service Account
{
"android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME": "com.google.android.apps.work.clouddpc/.receivers.CloudDeviceAdminReceiver",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM": "I5YvS0O5hXY46mb01BlRjq4oJJGs2kuUcHvVkAPEXlg",
"android.app.extra.PROVISIONING_DEVICE_ADMIN_PACKAGE_DOWNLOAD_LOCATION": "https://play.google.com/managed/downloadManagingApp?identifier=setup",
"android.app.extra.PROVISIONING_ADMIN_EXTRAS_BUNDLE": {
"com.google.android.apps.work.clouddpc.EXTRA_ENROLLMENT_TOKEN": "MHBHXZQECHGARCKAKSHF"
}
}
我是否必须为该服务帐户配置其他内容?
我在项目中启用了 Android Management API。