Giter VIP home page Giter VIP logo

gigya-client's Introduction

gigya-client

Latest Version on Packagist Software License Build Status Total Downloads Coverage Status Quality Score

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: add api_key and secret to https web requests
    • credentials: uses client_id and client_secret for use with oauth2 token retrieval
    • gigya-oauth2: uses an automatically retrieved OAuth2 token
    • custom: 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 [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

gigya-client's People

Contributors

adragus-inviqa avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.