2017 © Pedro Peláez
 

library oauth-client

oauth client for laravel

image

haoyanfei/oauth-client

oauth client for laravel

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-5-oauth-client

qq, weibo, weixin oauth for laravel 5, (*1)

QQ 调用示例

1.获取QQ验证的用户确认URL

$oauth = new OAuthClient();
$qq = $oauth->get('qq');
echo $qq->getAuthorizationUrl();

2.QQ回调处理

```PHP $oauth = new OAuthClient(); $provider = $oauth->get('qq'); // Try to get an access token (using the authorization code grant) $token = $provider->getAccessToken('authorization_code', [ 'code' => Input::get('code') ]);, (*2)

// Optional: Now you have a token you can look up a users profile data try {, (*3)

// We got an access token, let's now get the user's details
$userDetails = $provider->getUserDetails($token);
// Use these details to create a new profile
printf('Hello %s!', $userDetails->firstName);

} catch (Exception $e) {, (*4)

// Failed to get user details
exit('Oh dear...');

}, (*5)

echo ', (*6)

';
var_dump($userDetails);
echo "\n";

// Use this to interact with an API on the users behalf
echo $token->accessToken."\n";

// Use this to get a new access token if the old one expires
echo $token->refreshToken."\n";

// Number of seconds until the access token will expire, and need refreshing
echo $token->expires."\n";

var_dump($token);
echo '

'; ```, (*7)

The Versions

01/12 2015

dev-master

9999999-dev

oauth client for laravel

  Sources   Download

MIT

The Requires

 

12/05 2015

0.1.x-dev

0.1.9999999.9999999-dev

oauth client for laravel

  Sources   Download

MIT

The Requires

 

by Avatar Jzyuchen