bertonc96
bertonc96

Reputation: 826

Oauth2 requests json format

I'm trying to implement several workflows along with Oauth2 standard. I've seen that in different RFCs the request format suggested (and the only one mentioned) is application/x-www-form-urlencoded. Since my whole application relies on application/json request formats I was wondering if the application/x-www-form-urlencoded format for Oauth2 standard is mandatory or simply a suggestion.

Upvotes: 1

Views: 1545

Answers (1)

Gary Archer
Gary Archer

Reputation: 29208

It is mandatory according to standards documents, for grant messages sent to the token endpoint. The standard format for most messages is to POST form url encoded request bodies and JSON encoded response bodies.

The application/x-www-form-urlencoded message format is mentioned multiple times in the main RFC6749 document. Sending JSON request bodies will result in a 400 error.

Upvotes: 3

Related Questions