doutao4480 2018-12-23 04:43
浏览 619
已采纳

oauth令牌请求错误,“缺少必需的参数'client_id'”,

I'm trying to get a token from squares oauth. I can successfuly get the code but when i try to get the token i receive the error "missing required parameter 'client_id'".

I can successfully get a token from postman but not sure why oauth2.Exchange is not passing all info to the oauth server when I try to do it programmatically.

here is a gist of my oauth2.Config object: https://gist.github.com/yshuman1/dedaead8568e695df7a06f86cd986c2d

here is a gist of my failing callback function: https://gist.github.com/yshuman1/2b496e0fe698a5a0df087c60f4583677

Here is a gist of the redirect & callback functions as well as the oauth2.Config object: https://gist.github.com/yshuman1/b3c472978a4b1b73d6668dfe583f440f

In the callback gist, i also attempted passing in context.TODO() instead of context.Background().

any advice would be appreciated!

I've tried passing the missing items in but not sure what to do to get it done correctly.

I expect to receive a oath token back but dont. I'm getting the error { "message": "missing required parameter 'client_id'", "type": "bad_request.missing_parameter" }

  • 写回答

1条回答 默认 最新

  • dongyi9023 2019-01-04 07:40
    关注

    i ended up solving this by replacing the .Exchange method used to obtain a token with a simple http.POST request to obtain it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致