【问题标题】:Authentication with oauth2 on soundcloud api在 soundcloud api 上使用 oauth2 进行身份验证
【发布时间】:2023-03-29 07:12:01
【问题描述】:

我正在尝试使用他们的 API 登录 soundcloud。我设法从/connect 获得了成功响应的代码,但是当我尝试获得token 时,我最终得到了401 错误。这是我发送的内容:

POST /oauth2/token HTTP/1.1
Host: api.soundcloud.com
Content-Type: application/x-form-urlencoded
Cache-Control: no-cache
Postman-Token: 255c7769-0f65-5c40-27bc-9429ea8c38ea

client_id=<my client id>&
client_secret=<my secret id>&
redirect_uri=http%3A%2F%2Fmywebsite&
grant_type=authorization_code&
code=a99cfc85c0e46235d7fdb9ca74b7dddd%23  

有谁知道我在这里想念什么来获得工作请求?

【问题讨论】:

    标签: android http soundcloud


    【解决方案1】:

    原来我没有正确调用/connect,这是正确的方法:

    https://soundcloud.com/connect?
    client_id=<my client id>
    &redirect_uri=<my redirect url>
    &response_type=token
    &scope=non-expiring
    &display=popup
    

    使用response_type=token,我们直接收到访问令牌,因此我们不需要调用/oauth2/token

    【讨论】:

      猜你喜欢
      • 2013-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-11-03
      • 2021-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多