本文整理汇总了PHP中QC::get_access_token方法的典型用法代码示例。如果您正苦于以下问题:PHP QC::get_access_token方法的具体用法?PHP QC::get_access_token怎么用?PHP QC::get_access_token使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QC
的用法示例。
在下文中一共展示了QC::get_access_token方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOauthQQ
/**
* Action:OAuth 2.0 QQ
* @return Response
*/
public function getOauthQQ()
{
include_once app_path('api/qq/qqConnectAPI.php');
$qc = new QC();
$callback = $qc->qq_callback();
$openid = $qc->get_openid();
$qc = new QC($callback, $openid);
$access_token = $qc->get_access_token();
$arr = $qc->get_user_info();
$nickname = $arr["nickname"];
$credentials = array('email' => $openid, 'password' => $access_token);
if (Auth::attempt($credentials)) {
// Signin success, redirect to the previous page that was blocked
return Redirect::intended();
} else {
$user = new User();
$user->email = $openid;
$user->password = $access_token;
$user->nickname = $nickname;
$user->bound_type = '3';
$user->activated_at = date('Y-m-d H:m:s');
$user->save();
return View::make('authority.oauthQQ');
}
}