diff --git a/lib/OAuth2/OAuth2.php b/lib/OAuth2/OAuth2.php index 3a2d084..c738e88 100644 --- a/lib/OAuth2/OAuth2.php +++ b/lib/OAuth2/OAuth2.php @@ -760,7 +760,11 @@ public function grantAccessToken(Request $request = null) // Input data by default can be either POST or GET if ($request->getMethod() === 'POST') { - $inputData = $request->request->all(); + if (0 === strpos($request->headers->get('Content-Type'), 'application/json')) { + $inputData = json_decode($request->getContent(), true); + } else { + $inputData = $request->request->all(); + } } else { $inputData = $request->query->all(); }