Oauth 2.0 设备内应用程序的Google Fit授权代码

Oauth 2.0 设备内应用程序的Google Fit授权代码,oauth-2.0,google-fit,google-fit-sdk,Oauth 2.0,Google Fit,Google Fit Sdk,我正在尝试获取设备内应用程序的授权代码,但出现无效的作用域错误 我正在使用终端的以下命令进行呼叫: curl -d "client_id=XXX&scope=https://www.googleapis.com/auth/fitness.activity.read" https://accounts.google.com/o/oauth2/device/code 我得到的回应是: { "error" : "invalid_scope", "error_description"

我正在尝试获取设备内应用程序的授权代码,但出现无效的作用域错误

我正在使用终端的以下命令进行呼叫:

curl -d "client_id=XXX&scope=https://www.googleapis.com/auth/fitness.activity.read" https://accounts.google.com/o/oauth2/device/code
我得到的回应是:

{
  "error" : "invalid_scope",
  "error_description" : "Not authorized to request the scopes: [https://www.googleapis.com/auth/fitness.activity.read]",
  "error_uri" : "http://code.google.com/apis/accounts/docs/OAuth2.html"
}

我做错什么了吗?该应用程序已授权用于fitness api。

未为Google Fit API启用设备内oauth-2.0流。它现在已启用

资料来源: