cloudmanaged / oauth2-freeagent
league/oauth2-client的FreeAgent提供者
该软件包的规范仓库似乎已不存在,因此该软件包已被冻结。
v1.0.1
2015-07-16 14:49 UTC
Requires
- php: >=5.4.0
- league/oauth2-client: ~0.7
This package is not auto-updated.
Last update: 2024-05-11 15:45:49 UTC
README
这是一个将FreeAgent身份验证与The League of Extraordinary Packages的OAuth2客户端库集成的软件包。
要安装,请使用composer
composer require cloudmanaged/oauth2-freeagent
用法与league的OAuth客户端相同,使用\CloudManaged\OAuth2\Client\Provider\FreeAgent
作为提供者。例如
$provider = new \CloudManaged\OAuth2\Client\Provider\FreeAgent([ 'sandbox' => "TRUE_OR_FALSE", 'clientId' => "YOUR_CLIENT_ID", 'clientSecret' => "YOUR_CLIENT_SECRET", 'responseType' => "JSON_OR_STRING", 'redirectUri' => "http://your-redirect-uri" ]); $token = $provider->getAccessToken('refresh_token', [ 'grant_type' => 'refresh_token', 'refresh_token' => "REFRESH_TOKEN" ]); // OR (to get the token) $token = $this->provider->getAccessToken("authorizaton_code", [ 'code' => $_GET['code'] ]); // pass the token to the headers $provider->headers = ['Authorization' => 'Bearer ' . $token]; // returns an instance of CloudManaged\OAuth2\Client\Provider\Company $company = $this->provider->getUserDetails($token); // $company->name = [ Company name ] // $company->type = [ Company type ] // $company->company_registration_number = [ Company Registration Number ]
许可证
此提供者采用MIT许可证。请参阅提供者中的完整许可证。
关于
oAuth2FreeAgent是CloudManaged的一项倡议。另请参阅贡献者列表。
报告问题或功能请求
问题和功能请求在GitHub问题跟踪器中跟踪。
注意
如果您需要FreeAgent API的完整包装器,我们构建了这个freeagent-php库,目的是访问所有API资源。