2017 © Pedro Peláez
 

library oauth2-php-sdk

OAuth adapters

image

next-sentence/oauth2-php-sdk

OAuth adapters

  • Wednesday, February 3, 2016
  • by next-sentence
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

oauth-php-sdk

This PHP - SDK helps developer to connect to REST Api php application via OAuth2., (*1)

Example

<?php

use OAuth2\Factory;

require_once __DIR__ . './../vendor/autoload.php';

$config = array(
    'baseUri' => 'htttp://api.example.com',
    'client_id'     => 'client_id',
    'client_secret' => 'client_secret',
    'grant_type'    => 'password',
    'username'    => 'username',
    'password'    => 'password',
);

$factory  = new Factory();
$api = $factory->createApi($config);
try {
    $response = $api->call('v1/users.json', 'GET', $params = array());
    if ('200' == $response->getStatusCode()) {
        $users = json_decode($response->getContent());

        var_dump($users);
    }
} catch (Exception $e) {
    echo $e->getMessage();
}

The Versions

03/02 2016

dev-master

9999999-dev http://github.com/next-sentence/oauth2-php-sdk

OAuth adapters

  Sources   Download

The Requires

  • php >=5.3.0
  • ext-json *
  • ext-curl *

 

by Petru Binzari