无法从 Instagram 获取访问令牌

Unable to get access token from instagram

我正在使用这个 instagram wrapper package for laravel 5.1。我正在尝试通过 API 连接到 instagram,然后授权用户使用

use Vinkla\Instagram\Facades\Instagram;
public function instagramlogin(Request $request)
{
    // Get code parameter.
    $code = $request->get('code');

    // Request the access token.
    $data = Instagram::getOAuthToken($code);

    // Set the access token with $data object.
    Instagram::setAccessToken($data);

    // We're done here - how easy was that, it just works!
    Instagram::getUserLikes();
    // This example is simple, and there are far more methods available.
}

然后能够访问 his/her 配置文件数据。但我一直收到错误消息

ErrorException in Instagram.php line 526:
Undefined property: stdClass::$access_token

如何授权用户?

我解决了这个问题。你基本上必须使用 cosenary instagram package 因为这个包是那个包的包装器。因此,如果您 运行 通过 cosenary 包上的文档并改用 facades,这些功能将起作用。