yahoo oauth $user->getProfile(); returns null

烂漫一生 提交于 2019-12-25 01:51:46

问题


I'm using php and downloaded the yahoo library to import yahoo user info.

I've already finished it and it has been working flawlessly, but now it has started to return:

Notice (8): Trying to get property of non-object [APP/Vendor/Yahoo/Yahoo.inc, line 1036]

This notice appears after logging in through yahoo. When I debug $user->getProfile() it returns null.

I didn't change anything in my code that's why i don't have any idea what is causing it.

Please help!

This is the relevant part of my code:

App::import('Vendor', 'YahooInc', array('file' => 'Yahoo/Yahoo.inc'));
$session = YahooSession::requireSession($consumer_key,$consumer_secret,$app_id);
if (is_object($session)) {
    $yahooUser = $session->getSessionedUser();
    $yahooProfile = $yahooUser->getProfile();
}

回答1:


You have to replace your current Yahoo Api library with the below github branch.

https://github.com/syamvilakudy/yos-social-php


来源:https://stackoverflow.com/questions/20371336/yahoo-oauth-user-getprofile-returns-null

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!