Spring Oauth2.0缺少授权类型 [英] Spring Oauth2.0 Missing grant type

查看:105
本文介绍了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 。您可以查看此处了解说明 ..需要 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆