【问题标题】:Using OAuth 2.0 for Devices :Some requested scopes were invalid对设备使用 OAuth 2.0:某些请求的范围无效
【发布时间】:2015-03-09 13:47:09
【问题描述】:

获得客户端 ID 和客户端密码后,您可以向位于 https://accounts.google.com/o/oauth2/device/code 的 OAuth 2.0 设备端点发送 HTTP POST,其中包含您的 client_id 和范围列表。与其他 OAuth 2.0 流程不同,设备流程中不需要 response_type 和 redirect_uri。以下是用户代码的示例请求:

POST /o/oauth2/device/code HTTP/1.1 主机:accounts.google.com 内容类型:application/x-www-form-urlencoded

client_id=812741506391-h38jh0j4fv0ce1krdkiq0hfvt6n5amrf.apps.googleusercontent.com& scope=email%20profile

我试过了,但结果一直都是:

{ “错误”:“无效范围”, "error_description" : "某些请求的范围无效。{invalid=[rad365rad@gmail.com]}", “error_uri”:“http://code.google.com/apis/accounts/docs/OAuth2.html” }

任何人都可以解决这个问题..我哪里错了

【问题讨论】:

  • 我已经向上述 url 发出了发布请求,但得到了相同的响应,请有人帮我获得如下输出:{ "device_code" : "4/4-GMMhmHCXhWEzkobqIHGG_EnNYYsAkukHspeYUk9E8", "user_code" : “GQVQ-JKEC”、“verification_url”:“google.com/device”、“expires_in”:1800、“间隔”:5 }

标签: android


【解决方案1】:

您可以从这里开始,这应该可以帮助您获取设备代码

curl -d "client_id=xxxxxxxxxxxxxxxxx.apps.googleusercontent.com&scope=email profile" https://accounts.google.com/o/oauth2/device/code

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-19
    • 2020-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-05
    • 1970-01-01
    相关资源
    最近更新 更多