You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enable the token endpoint to handle the POST requests in JSON, the [Body Parsing Middleware](https://docs.mezzio.dev/mezzio/v3/features/helpers/body-parse/) helper must be included in the application.
25
+
26
+
For example:
27
+
28
+
```php
29
+
use Mezzio\Authentication\OAuth2;
30
+
use Mezzio\Helper\BodyParams\BodyParamsMiddleware;
31
+
32
+
$app->post('/oauth2/token', [
33
+
BodyParamsMiddleware::class,
34
+
OAuth2\TokenEndpointHandler::class
35
+
], 'auth.token');
36
+
```
37
+
WARNING: Do not pipe the body parsing middleware as generic middleware.
38
+
This ensures that the content body is only parsed when it is actually expected.
0 commit comments