kdubuc/oauth2-introspection-psr15

PSR15 OAuth2 Introspection 中间件

dev-main 2022-05-11 07:20 UTC

This package is auto-updated.

Last update: 2024-09-11 12:11:22 UTC


README

使用OAuth 2.0令牌Introspection保护您的API RFC 7662.

PSR-6 可以用于在令牌有效期(如果通过Introspection端点指定令牌的过期时间戳)内存储Introspection数据。

安装

通过Composer

$ composer require kdubuc/oauth2-introspection-psr15

用法

$middleware =  new Oauth2Introspection($http_psr18_client, $http_stream_psr17_factory, $http_request_psr17_factory, [
    'introspection_endpoint' => 'http://oauth2.example.com/introspect',
    'oauth2_client_id'       => 'client_id',
    'oauth2_client_secret'   => 'client_secret',
]);

$middleware->enableCache($psr6_cache);

// Introspection results will be stored into 'oauth2_access_token_introspection_data' request attribute

测试

$ vendor/bin/phpunit tests/

贡献

请参阅 CONTRIBUTING 获取详细信息。

安全

如果您发现任何与安全相关的问题,请通过电子邮件 kevindubuc62@gmail.com 而不是使用问题跟踪器。

致谢

许可证

CeCILL-B许可证。有关更多信息,请参阅 许可证文件