oauth2-server-php icon indicating copy to clipboard operation
oauth2-server-php copied to clipboard

application/x-www-form-urlencoded or multipart/form-data?

Open alkhoo opened this issue 13 years ago • 1 comments

Currently, oauth2 library supports only application/x-www-form-urlencoded,

Question: To upload a file (image), it requires a POST of multipart/form-data, if I add access_token to the submission, oauth2 won't work since it doesn't support it.

Need advice on the posibble work-around or patch. Offhand, it is easy to write a subroutine which checks against the stored access token, but that breaks the oauth2 flow.

Thanks in advance, Alvin

alkhoo avatar Jul 03 '13 22:07 alkhoo

If you submit the POST request using multipart/form-data, you can include the access token parameter using the AUTHENTICATE header, or the access_token querystring parameter. The multipart/form-data encoding IS supported, but when used the access token is not allowed in the request body.  — Brent Shaffer

On Wed, Jul 3, 2013 at 3:18 PM, alkhoo [email protected] wrote:

Currently, oauth2 library supports only application/x-www-form-urlencoded, Question: To upload a file (image), it requires a POST of multipart/form-data, if I add access_token to the submission, oauth2 won't work since it doesn't support it. Need advice on the posibble work-around or patch. Offhand, it is easy to write a subroutine which checks against the stored access token, but that breaks the oauth2 flow. Thanks in advance,

Alvin

Reply to this email directly or view it on GitHub: https://github.com/bshaffer/oauth2-server-php/issues/184

bshaffer avatar Jul 03 '13 22:07 bshaffer