如何解决授权服务器 osu api 不支持授权授予类型
用户将按下登录按钮,该按钮会将他们定向到授权网站 osu auth
然后将被重定向回带有代码的网站
code = request.query_string
name_verify = str(code).split('code=')[1]
#re.search("(?!\w+=)\w+",str(code)) #getting the code
print(name_verify)
response = requests.post("https://osu.ppy.sh/oauth/token",data = { 'client_id': xxxx,'client_secret': "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",'redirect_uri': "https://osu-api-crap.minecreeper0913.repl.co",'scope':'public','code': name_verify,'grant_type':'authorization_code'},headers={'Accept': 'application/json','Content-Type': 'application/json'})
print(response.text)
有人告诉我这是正确的方法,但它总是导致“授权服务器不支持授权授予类型”
解决方法
令牌请求 (RFC 6749 Section 4.1.3) 的 Content-Type 必须是 application/x-www-form-urlencoded
尽管 令牌响应 (RFC 6749 { {3}}) 是 JSON。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。