2017 © Pedro Peláez
 

library oauth2-qq

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

image

spoonwep/oauth2-qq

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  • Wednesday, October 25, 2017
  • by chengcheng
  • Repository
  • 2 Watchers
  • 6 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 11 Versions
  • 16 % Grown

The README.md

oauth2-qq

QQ OAuth 2.0 support for the PHP League's OAuth 2.0 Client, (*1)

Install

You can open a terminal and type in, (*2)

composer require spoonwep/oauth2-qq

or require in a composer.json, (*3)

"require": {
    "spoonwep/oauth2-qq": "~1.3"
}

then run:, (*4)

composer update

Useage

session_start();
$provider = new \Spoonwep\OAuth2\Client\Provider\Qq([
    'clientId' => '{QQ APP ID}',
    'clientSecret' => '{QQ APP KEY}',
    'redirectUri' => 'http://example.com/callback-url',
]);
if (!isset($_GET['code'])) {
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    header('Location: '.$authUrl);
    exit;
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
    unset($_SESSION['oauth2state']);
    exit('Invalid state');
} else {
    $token = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    //fetch userinfo returned by serverside
    $user = $provider->getResourceOwner($token);
    $user = $user->toArray();
    print_r($user);

    //get user's unique openid from serverside
    $openid = $provider->openid;
    printf('User\'s openid:%s', $openid);
}

License

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

The Versions

25/10 2017

dev-master

9999999-dev

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/10 2017

1.3.7

1.3.7.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/10 2017

1.3.6

1.3.6.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/10 2017

1.3.5

1.3.5.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/10 2017

1.3.4

1.3.4.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/10 2017

1.3.3

1.3.3.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/01 2016

1.3.2

1.3.2.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/01 2016

1.3.1

1.3.1.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/01 2016

1.3

1.3.0.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

25/01 2016

1.2

1.2.0.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation

23/01 2016

1.1

1.1.0.0

QQ OAuth 2.0 Client Provider for The PHP League OAuth2-Client

  Sources   Download

MIT

The Requires

 

authorization oauth client oauth2 qq authorisation