json - OAuth2 中 token 请求的内容类型

标签 json urlencode oauth2

开始好奇 https://tools.ietf.org/html/rfc6749#section-4.1.1

看一看:

The client constructs the request URI by adding the following
parameters to the query component of the authorization endpoint URI
using the "application/x-www-form-urlencoded" format



...服务器必须响应“application/json”。

问题是:
  • 为什么我们要明确使用“application/x-www-form-urlencoded”?
  • urlencoded 有什么明显的好处吗?
  • 是什么阻止我在这里接受 urlencoded 和 json?似乎,我并没有真正以这种方式违反 RFC。
  • 最佳答案

    我也遇到过这个问题。我不知道 urlencoded 是否有任何好处,但这个行业的大玩家 auth0.com 正在使用 application/json请求和响应的内容类型。

    enter image description here

    关于json - OAuth2 中 token 请求的内容类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40998133/

    相关文章:

    javascript - 如何从 jQuery 的 $.get 方法中提取对象?

    javascript - AngularJS 日期输入与来自 json 的日期

    java - 汉字编码?

    oauth-2.0 - 隐式流的安全风险是什么

    oauth-2.0 - OAuth2.0 加密前刷新 token 的内容格式应该是什么?

    json - ConvertFrom-Json PowerShell Cmdlet 不解析整个 JSON 对象

    ruby - URL 编码每个可能的字符

    php urlencode 和 htmlspecialchars html <a href> 中启动函数内的变量

    oauth2 - authenticate_client和access_denied有什么区别

    javascript - Highcharts 循环 JSON 对象来填充数据系列