graze/gigya-client
gigya-client
Client for Gigya's REST API
- Endpoint call hierarchy:
$gigya->accounts()->tfa()->getCertificate() - List of endpoints:
accounts,accounts->tfa,audit,socialize,comments,gameMechanics,reports,dataStore,identityStorage,saml,saml->idp - Populated classes with auto completion helpers for the available methods from Gigya
- Different authentication methods:
gigya: addapi_keyandsecretto https web requestscredentials: usesclient_idandclient_secretfor use with oauth2 token retrievalgigya-oauth2: uses an automatically retrieved OAuth2 tokencustom: use your own custom authentication (or use oauth2 with a provided token)
Install
The simplest way to install the client is with composer and running:
$ composer require graze/gigya-client
Usage
By Default the Gigya client uses gigya auth and appends the api_key and secret onto the query string when calling gigya over https.
$gigya = new Gigya($key, $secret);
$response = $gigya->accounts()->getAccountInfo(['uid' => $uid]);
if ($response->getErrorCode() === ErrorCode::OK) {
$account = $response->getData();
}
OAuth 2
You can also use oauth2 in server mode and retrieve information about all accounts
$gigya = new Gigya($key, $secret, $region, $user, ['auth'=>'gigya-oauth2']);
$response = $gigya->accounts()->getAccountInfo(['uid' => $uid]);
$account = $response->getData();
Social OAuth 2
OAuth2 can also be used to retrieve information about a single account without knowledge of the uid.
$grant = new ManualGrant();
$gigya = new Gigya($key, $secret, $region, null, ['auth' => 'oauth2-custom']);
$gigya->addHandler(OAuth2Subscriber::middleware($grant, 'oauth2-custom'));
$tokenResponse = $gigya->socialize()->getToken([
'grant_type' => 'code',
'authorization_code' => '<xxxxx>',
'redirect_uri' => '<xxxxx>',
], ['auth' => 'credentials']);
$grant->setToken($tokenResponse->getData()->get('access_token'));
$response = $gigya->accounts()->getAccountInfo();
$account = $response->getData();
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
$ make install
$ make test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email security@graze.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.0.2 | ^5.5| | ^5.0| | MIT | |
| 2.0.1 | >=5.5.0| | ^5.0 | MIT | |
| v2.0.0 | >=5.5.0| | ^5.0 | MIT | |
| v1.0.0 | >=5.5.0 | ^5.0 | MIT | |
| v0.2.1 | >=5.5.0 | ^5.0 | MIT | |
| v0.2.0 | >=5.5.0 | ^5.0 | MIT | |
| v0.1.0 | >=5.5.0 | ^5.0 | MIT |
Pre-releases (1)
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.0.0-rc1 | >=5.5.0 | ^5.0 | MIT |