【发布时间】:2018-06-28 19:16:06
【问题描述】:
我正在开发 Instagram API,我想通过 Instagram 进行身份验证。第一步 - 将用户重定向到 IG 页面。 我正在重定向
return redirect()->away('https://api.instagram.com/oauth/authorize/?client_id='. $this->client_id .'&redirect_uri='. url('instagram/login/callback') .'&response_type=code');
登录时出现错误 - 不支持驱动程序 [instagram]
我已经在 services.php, ENV 文件中编写了 IG API 凭据。我在 Instagram 网站上创建了客户端。但是每次,当用户登录并重定向回来时 - 他都会收到这个错误。我在谷歌上搜索了 2 天。我什至使用了来自 github 的 2-3 个包用于 Instagram,但我仍然遇到同样的错误。我用各种可能的方式清除了缓存 - 所有 php artisan clear 命令,从 /bootstrap 目录手动删除缓存。
FB API 运行良好,但不是这样。
这是我的配置:
.env
INSTAGRAM_ID=54c582bd3ea944b78f741c8aac3001ce
INSTAGRAM_SECRET=4a3***********8c
services.php
'instagram' => [
'client_id' => env('INSTAGRAM_ID'),
'client_secret' => env('INSTAGRAM_SECRET'),
'redirect' => '/instagram/login/callback',
],
InstagramController.php
class InstagramController extends Controller
{
private $client_id;
private $client_secret;
public function __construct(Request $request)
{
$this->client_id = config('services.instagram.client_id');
$this->client_secret = config('services.instagram.client_secret');
}
/**
* Show Instagram API submit page
*
* @return \Illuminate\View\View
*/
public function getAPIPage(Request $request){
return redirect()
->away('https://api.instagram.com/oauth/authorize/?
client_id='. $this->client_id .'&redirect_uri='.
url('instagram/login/callback') .'&response_type=code');
}
}
我正在使用 Laravel Socialite。
我还能做什么?
【问题讨论】:
-
你在使用 laravel socialite 吗?
-
是的,我正在使用社交名流
-
你添加了吗?
\SocialiteProviders\Manager\ServiceProvider::class, -
是的。我说 FB 运行良好
-
做一些缓存和配置清除,我记得我在
linkedin有这样的错误,一段时间后错误消失了
标签: php laravel instagram-api