【发布时间】:2016-01-14 19:04:59
【问题描述】:
我正在使用这个库 https://github.com/artdarek/oauth-4-laravel
这是我的代码
public function loginWithYahoo() {
// get data from input
$token = Input::get( 'oauth_token' );
$verify = Input::get( 'oauth_verifier' );
// get yahoo service
$yh = OAuth::consumer( 'Yahoo' );
// if code is provided get user data and sign in
if ( !empty( $token ) && !empty( $verify ) ) {
// This was a callback request from yahoo, get the token
$token = $yh->requestAccessToken( $token, $verify );
$xid = array($token->getExtraParams());
$result = json_decode( $yh->request( 'https://social.yahooapis.com/v1/user/'.$xid[0]['xoauth_yahoo_guid'].'/profile?format=json' ), true );
dd($result);
}
// if not ask for permission first
else {
// get request token
$reqToken = $yh->requestRequestToken();
// get Authorization Uri sending the request token
$url = $yh->getAuthorizationUri(array('oauth_token' => $reqToken->getRequestToken()));
// return to yahoo login url
return Redirect::to( (string)$url );
}
}.
我收到以下错误..任何人都可以给点提示吗???提前谢谢 调用未定义的方法 OAuth\OAuth2\Service\Yahoo::requestRequestToken()
【问题讨论】:
标签: php oauth laravel-5 yahoo-api