2016-09-07 56 views
2

我正在使用Spring Oauth 2.O.Spring Oauth2.0失蹤授予類型

當我作爲表單數據傳遞請求時,它工作正常,但是當我嘗試以application/json格式傳遞數據時,它給我錯誤缺少授權類型。

請求

http://localhost:8080/oauth/token 

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

的錯誤,我得到。

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

請指導。

回答

13

OAuth2不支持JSON訪問令牌request.You可以檢查here for description ..它需要application/x-www-form-urlencoded