Spring Oauth2.0缺少授权类型 [英] Spring Oauth2.0 Missing grant type
本文介绍了Spring Oauth2.0缺少授权类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Spring Oauth 2.O。
I am using Spring Oauth 2.O.
当我将请求作为表单数据传递时,它工作正常,但是当我尝试在<$中传递数据时c $ c> application / json 格式,它让我错误地忽略了授权类型。
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.
请求
http://localhost:8080/oauth/token
{"username":"parths","password":"123456","grant_type":"password"}
我收到错误。
{
"status": "0",
"message": "Missing grant type"
}
请指南。
推荐答案
OAuth2
不支持 JSON 访问令牌请求中的code>。您可以查看此处了解说明 ..需要
application / x-www-form-urlencoded
OAuth2
doesn't support JSON
in the access token request.You can check here for description..It requires application/x-www-form-urlencoded
这篇关于Spring Oauth2.0缺少授权类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文