2017 © Pedro Peláez
 

library oauth-client

php open authentication server sdk

image

mhndev/oauth-client

php open authentication server sdk

  • Monday, November 27, 2017
  • by majidphpdeveloper
  • Repository
  • 3 Watchers
  • 2 Stars
  • 425 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 51 Versions
  • 0 % Grown

The README.md

Php OAuth Client (Sdk)

tokens table structure :, (*1)

    CREATE TABLE tokens (
        client_id TEXT NOT NULL PRIMARY KEY,
        client_secret TEXT NOT NULL,
        credentials TEXT NOT NULL,
        type TEXT NOT NULL,
        expires_at datetime
    );

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);


require_once 'vendor/autoload.php';


$client_id = 1;
$client_secret = 'DONjJxACnkVqzHPoHOoUmfEmUjnDnXJiT0PuqCzO';

$tokenRepository = new \mhndev\oauthClient\repository\TokenRepositorySqlite(
    (new \mhndev\oauthClient\SqLiteConnection(__DIR__.DIRECTORY_SEPARATOR.'db.sqlite'))->connect()
);

$guzzleClient = new \GuzzleHttp\Client();

$guzzleHandler = new \mhndev\oauthClient\handlers\GuzzleHandler(
    $guzzleClient,
    'http://dev.digipeyk.com:8030'
);

// if you want to pass api ednpoints and you are not going to use default endpoints please pass the third argument as follow:
// consider you can just override as many endpoint as you want, and you are not forced to override all endpoints
$guzzleHandler = new \mhndev\oauthClient\handlers\GuzzleHandler(
    $guzzleClient,
    'http://dev.digipeyk.com:8030',
    ['removeIdentifier' => '/api/removeUserIdentifier']
);

$oauth_client = new \mhndev\oauthClient\Client($guzzleHandler, $tokenRepository);

$token = $oauth_client->getClientToken($client_id, $client_secret);

//register endpoint
$user_register = $oauth_client->register(
    'hamid',
    '123456',
    ['email'=>'ma2jid8911303@gmail.com'],
    $token
);

var_dump($user_register);

// whois endpoint

$user_whoIs = $oauth_client->getWhois(
    'email',
    'majid8911303@gmail.com',
    $token
);


var_dump($user_whoIs);

// get Token Info

$tokenValueObject = new \mhndev\valueObjects\implementations\Token(
    $token->getCredentials(), $token->getType()
);

$tokenInfo = $oauth_client->getTokenInfo($tokenValueObject);

var_dump($tokenInfo);



echo '<br><br><br><br><br>';

// now using mock handler instead as handler

$mockHandler = new \mhndev\oauthClient\handlers\MockHandler();

$oauth_client2 = new \mhndev\oauthClient\Client($mockHandler, $tokenRepository);


$tokenFromMock = $oauth_client2->getClientToken('wefwergderf', 'werwrgfer');

var_dump($tokenFromMock);

$result = $oauth_client2->register(
    'majid',
    '123456',
    ['email' => 'majid@gmail.com'],
    new \mhndev\oauthClient\entity\common\Token(
        'Bearer',
        '34r3t354t54tr',
        $client_id,
        $client_secret
    )
);


var_dump($result);


todo : toArray for oauth objects, (*2)

The Versions

27/11 2017

dev-master

9999999-dev

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/11 2017

dev-develop

dev-develop

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/11 2017

2.16.0

2.16.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

24/11 2017

2.15.1

2.15.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

20/11 2017

2.15.0

2.15.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

13/11 2017

2.14.3

2.14.3.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

13/11 2017

2.14.2

2.14.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

16/09 2017

2.14.1

2.14.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

29/08 2017

2.14.0

2.14.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

28/08 2017

2.13.0

2.13.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

26/08 2017

2.12.0

2.12.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

09/08 2017

2.11.3

2.11.3.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

17/07 2017

2.11.2

2.11.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

28/06 2017

2.11.1

2.11.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

28/06 2017

2.9.1

2.9.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

17/06 2017

2.11.0

2.11.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

12/06 2017

2.10.0

2.10.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

12/06 2017

2.9.0

2.9.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

10/06 2017

2.8.0

2.8.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

10/06 2017

2.7.0

2.7.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

30/05 2017

2.6.0

2.6.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

29/05 2017

2.5.0

2.5.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

28/05 2017

2.4.0

2.4.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/05 2017

2.3.4

2.3.4.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

24/05 2017

2.3.3

2.3.3.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

21/05 2017

2.3.2

2.3.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

16/05 2017

2.3.1

2.3.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

15/05 2017

2.3.0

2.3.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

15/05 2017

2.2.0

2.2.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

08/05 2017

2.1.1

2.1.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

08/05 2017

2.1.0

2.1.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

07/05 2017

2.0.3

2.0.3.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

07/05 2017

2.0.2

2.0.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

07/05 2017

2.0.1

2.0.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

07/05 2017

2.0.0

2.0.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

07/05 2017

1.8.1

1.8.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

06/05 2017

1.8.0

1.8.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

01/05 2017

1.7.0

1.7.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

01/05 2017

1.6.0

1.6.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/04 2017

1.5.1

1.5.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/04 2017

1.5.0

1.5.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

27/04 2017

1.4.2

1.4.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

24/04 2017

1.4.1

1.4.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

23/04 2017

1.3.2

1.3.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

23/04 2017

1.3.1

1.3.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

23/04 2017

1.3.0

1.3.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

20/04 2017

1.2.0

1.2.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

19/04 2017

1.1.2

1.1.2.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

19/04 2017

1.1.1

1.1.1.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

17/04 2017

1.1.0

1.1.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication

16/04 2017

1.0.0

1.0.0.0

php open authentication server sdk

  Sources   Download

MIT

The Requires

 

The Development Requires

authentication auth oauth client open authentication