Example #1
0
 public function callback()
 {
     include_once 'weibooauth.php';
     $keys = $this->getOAuthData(self::RequestTokenName);
     $o = new SaeTOAuth($this->WB_AKEY, $this->WB_SKEY, $keys['oauth_token'], $keys['oauth_token_secret']);
     $last_key = $o->getAccessToken($_REQUEST['oauth_verifier']);
     $this->setOAuthData(self::AccessTokenName, $last_key);
     #var_dump($keys);var_dump($last_key);
 }
Example #2
0
<?php

session_start();
// 验证用户是否已经登录新浪OAuth认证
if (isset($_SESSION['last_key'])) {
    header('Location: ready.php');
}
include_once 'config.php';
include_once 'weibooauth.php';
//获取Session 调用callback
$o = new SaeTOAuth(WB_AKEY, WB_SKEY);
$keys = $o->getRequestToken();
$aurl = $o->getAuthorizeURL($keys['oauth_token'], false, 'http://' . $_SERVER['HTTP_APPNAME'] . '.sinaapp.com/callback.php');
$_SESSION['keys'] = $keys;
?>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title>测测你是哪个奥特曼        by @XDash</title>

	<style type="text/css">
		body {
			background-color:#436eb2;
		}
		#content {
			display:block;
			width:460px;
Example #3
0
 function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL)
 {
     parent::__construct($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
 }
Example #4
0
 function __construct($client_id, $client_secret, $access_token = NULL, $refresh_token = NULL)
 {
     parent::__construct($client_id, $client_secret, $access_token, $refresh_token);
 }
<?php

session_start();
include_once 'config.php';
include_once 'weibooauth.php';
$o = new SaeTOAuth(WB_AKEY, WB_SKEY, $_SESSION['keys']['oauth_token'], $_SESSION['keys']['oauth_token_secret']);
$last_key = $o->getAccessToken($_REQUEST['oauth_verifier']);
$_SESSION['last_key'] = $last_key;
// 授权完成
header('Location: ready.php');