scigroup/api-client

v0.0.2 2017-09-28 14:11 UTC

This package is not auto-updated.

Last update: 2024-09-15 04:36:43 UTC


README

用法

  • 使用具有 ROLE_OAUTH_SERVER 角色的命令获取 client_id/client_secret 对。
  • 初始化一个 Client 类的对象以进行请求。

ROLE_OAUTH_SERVER 提供以下方法的访问权限

  • Client::eventSearch

ROLE_OAUTH_TRUSTED_SERVER 提供以下方法的访问权限

  • Client::requestPasswordResetting
  • Client::resetPassword

示例

// Implement HTTPTransportInterface interface
$authenticator = new OAuthAuthenticator('https://base/path/to/auth/endpoint', 'client_id', 'client_secret', new FileTokenStorage(), $HTTPTransport);
$client = new Client('https://base/path', $authenticator, $HTTPTransport);