enyk/authcore-php

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v0.2) of this package.

A PHP SDK for Authcore

v0.2 2021-06-22 09:13 UTC

This package is not auto-updated.

Last update: 2022-04-26 13:29:33 UTC


README

Authcore SDK for PHP

Prerequisite

This SDK uses Composer to manage its dependency.

Usage

$ composer require enyk/authcore-php

For detailed usage please refer to /demo for a demo project.

Also refers to /docs/index.html in your Authcore installation for a API documentation.

Authcore Client

For user having the access token, initialize authcore client only needs clientId, baseURL and accessToken.

$authcore = new Authcore([
    'clientId' => 'app',
    'baseURL' => 'https://authcore.io/api/v2/',
    'accessToken' => $accessToken
]);

// then it can be used to call API function as in API docs
// e.g.
$resp = $authcore->client->getCurrentUser();

For service accounts, initialize authcore client requires clientId, baseURL, serviceAccountId and serviceAccountKeyPath for accessing the private key of the service account.


$authcore = new Authcore([
    'clientId' => 'management',
    'baseURL' => 'https://authcore.io/api/v2/',
    'serviceAccountId' => 1,
    'serviceAccountKeyPath' => 'path/to/private/key.pem'
]);

// then it can be used to call API function as in API docs, using the service account's permission
// e.g.
$resp = $authcore->client->listUser();

For available API and their parameter, see /docs/index.html under the authcore instance and the PHP function signatures.