compwright / oauth2-fieldedge
The PHP League OAuth2-Client 的 FieldEdge OAuth 2.0 客户端提供者
v1.0.0
2022-12-09 18:43 UTC
Requires
- php: ^7.4 || ^8
- lcobucci/jwt: ^4.2
- league/oauth2-client: ^2.5
- psr/http-message: ^1.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.6
This package is auto-updated.
Last update: 2024-09-09 23:00:56 UTC
README
此包为 PHP League 的 OAuth 2.0 客户端 提供FieldEdge OAuth 2.0 支持。
安装
要安装,请使用 composer
composer require compwright/oauth2-fieldedge league/oauth2-client
用法
用法与 The League 的 OAuth 客户端相同,使用 \Compwright\OAuth2_Fieldedge\Provider
作为提供者。
示例:客户端凭证流程
$provider = new Compwright\OAuth2_Fieldedge\Provider([ 'clientId' => '{fieldedge-client-id}', 'clientSecret' => '{fieldedge-api-key}', ]); // Get an access token $token = $provider->getAccessToken('client_credentials'); // Use the token to interact with an API on the users behalf echo $token->getToken(); // The token is really a JWT, getResourceOwnerId() extracts the company_id claim echo $token->getResourceOwnerId();
测试
$ make test
贡献
请参阅 CONTRIBUTING 获取详细信息。
鸣谢
许可证
MIT 许可证(MIT)。请参阅 许可证文件 获取更多信息。