Spring Oauth2.0 Missing grant type

不想你离开。 提交于 2019-11-30 08:19:42

问题


I am using Spring Oauth 2.O.

When I pass request as a form-data it works fine, but when I try to pass data in application/json format it gives me error missing grant type.

Request

http://localhost:8080/oauth/token

{"username":"parths","password":"123456","grant_type":"password"}

Error I getting.

{
  "status": "0",
  "message": "Missing grant type"
}

Please Guide.


回答1:


OAuth2 doesn't support JSON in the access token request.You can check here for description..It requires application/x-www-form-urlencoded



来源:https://stackoverflow.com/questions/39366281/spring-oauth2-0-missing-grant-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!