Spring Oauth2.0缺少授权类型

Par*_*nki 10 java spring spring-security spring-security-oauth2

我正在使用Spring Oauth 2.O.

当我将请求作为表单数据传递时,它可以正常工作,但是当我尝试以application/json格式传递数据时,它会让我错误地忽略授权类型.

请求

http://localhost:8080/oauth/token

{"username":"parths","password":"123456","grant_type":"password"}
Run Code Online (Sandbox Code Playgroud)

我得到的错误.

{
  "status": "0",
  "message": "Missing grant type"
}
Run Code Online (Sandbox Code Playgroud)

请指南.

Pra*_*mar 25

OAuth2JSON在访问令牌请求中不支持.您可以在此处查看说明 ..它需要application/x-www-form-urlencoded