nxtbgthng / OAuth2Client

Client library for OAuth2 (currently built against draft 10 of the OAuth2 spec)
855 stars 217 forks source link

APIs requiring token exchange parameters in query string #78

Open stigi opened 11 years ago

stigi commented 11 years ago

According to #72 and others there are APIs that do no accept the token request parameters in the POST form body. Such APIs are

It might be possible to add a configuration for such APIs that sends the parameters in the query string. But let's discuss this first, as those APIs are clearly not implementing the OAuth2 standard correctly. See the spec for more info:

The client makes a request to the token endpoint by sending the
following parameters using the "application/x-www-form-urlencoded"
format per Appendix B with a character encoding of UTF-8 in the HTTP
request entity-body
mitrenegade commented 11 years ago

I encountered the same issue, and authentication failed when I had a long set of parameters that were encoded as multipart/form data, from a dictionary to JSON to data. But I manually converted the httpbody parameters into form-urlencoded data as a string like "client_id=...&client_data=...", it was still sent in the httpbody but now with Content-Type = application/x-www-form-urlencoded, and it worked. Perhaps there could be a toggle to send data that way instead? This is in