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.
27
+
28
+
For example:
29
+
30
+
```php
31
+
use Mezzio\Authentication\OAuth2;
32
+
use Mezzio\Helper\BodyParams\BodyParamsMiddleware;
33
+
34
+
$app->post('/oauth2/token', [
35
+
BodyParamsMiddleware::class,
36
+
OAuth2\TokenEndpointHandler::class
37
+
], 'auth.token');
38
+
```
39
+
40
+
WARNING: Do not pipe the body parsing middleware as generic middleware.
41
+
This ensures that the content body is only parsed when it is actually expected.
42
+
24
43
## Add the authorization endpoint
25
44
26
45
The authorization endpoint is the URL to which the client redirects
0 commit comments