whirlwind-framework / middleware-oauth2
Whirlwind framework PSR-15 oauth2 middleware
v0.0.3
2022-05-02 18:56 UTC
Requires
- php: ~7.4||>=8.0
- ext-json: *
- psr/cache: ^1.0
- psr/http-client: ^1.0
- whirlwind-framework/framework: *
Requires (Dev)
- dg/bypass-finals: ^1.2
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
This package is not auto-updated.
Last update: 2024-10-29 06:31:06 UTC
README
Validates Bearer token in:
- "Authorization" header (Bearer prefix required)
- "access_token" query param (Bearer prefix must be omitted)
- "access_token" field in body (Bearer prefix must be omitted)
Example of usage:
$middleware = $container->get(AuthMiddleware::class);
$app->map('GET', '/api/v1/messages', \App\Api\Action\Message\v1\MessageIndexAction::class)
->middleware($middleware->withRequiredScopes(['communication-messages.index']));