Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
675 views
in Technique[技术] by (71.8m points)

java - Spring Oauth2.0 Missing grant type

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...