Laravel。不支持驱动程序 [instagram]。无法处理回调响应
Laravel. Driver [instagram] not supported. Cannot handle the callback response
我正在使用 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 天。我什至为 Instagram 使用了 github 中的 2-3 个包,但我仍然遇到同样的错误。我用各种可能的方式清除缓存 - 所有 php artisan 清除命令,手动从 /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。
我还能做什么?
已解决。
@sam 告诉我按照说明做所有事情。我之前没有添加侦听器事件,但是当我添加它时 - API 起作用了。我不明白为什么,但我们需要在 EventServiceProvider.php.
中添加监听器 类
一步一步做:
http://socialiteproviders.github.io/providers/instagram/
我正在使用 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 天。我什至为 Instagram 使用了 github 中的 2-3 个包,但我仍然遇到同样的错误。我用各种可能的方式清除缓存 - 所有 php artisan 清除命令,手动从 /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。
我还能做什么?
已解决。
@sam 告诉我按照说明做所有事情。我之前没有添加侦听器事件,但是当我添加它时 - API 起作用了。我不明白为什么,但我们需要在 EventServiceProvider.php.
中添加监听器 类一步一步做: http://socialiteproviders.github.io/providers/instagram/