在网上找个Demo,可以通过新浪的接口实现验证
代码中在最后验证返回时有个callback函数
public function callBack()
{
$site     = trim($_GET['src']);
$key      = new key($site);
$url      = new url($site);
$param    = new param($site);
           //  echo $site."<br />";//sina
$verifier = trim($_GET[$param -> getVerifier()]);
if(!$verifier) $this -> report('授权失败');
try{
$client   = new WeiboOAuth($key -> getAppKey(),$key -> getSecretKey(),$this -> sess['oauth'][$param -> getRequestToken()],$this -> sess['oauth'][$param -> getRequestTokenSecret()]);
$client -> setUrlInstance($url);   //设定API路径类
$token    = $client -> getAccessToken($verifier);
$key     = $token[$param -> getAccessToken()]; // "oauth token"
$secret   = $token[$param -> getAccessTokenSecret()];
}catch(Exception $e){
echo $e -> getMessage() . '<br>' . $e ->getTrace();
}
unset($this -> sess['oauth']);
if(!$key || !$secret) $this -> report('认证失败');
$this -> report('认证成功');
}
}
里面的$param应该是个加过密的数组吧,里面有用户名吗,如何能得到呢
运行的结果为:认证成功